Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for cjs #79

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: add support for cjs #79

wants to merge 1 commit into from

Conversation

tmm1
Copy link

@tmm1 tmm1 commented Oct 19, 2024

want to import this package in a nodejs environment where commonjs modules are being used

@tmm1 tmm1 changed the title add support for cjs [feat] add support for cjs Oct 19, 2024
@tmm1 tmm1 changed the title [feat] add support for cjs feat: add support for cjs Oct 19, 2024
@tmm1
Copy link
Author

tmm1 commented Oct 19, 2024

this worked, but now i'm having the same issue with the uint8arrays dependency. from the project where i'm trying to use this:

@connectrpc/connect-node:test:     Failed: require() of ES Module node_modules/uint8arrays/dist/src/alloc.node.js from node_modules/uint8arraylist/dist/cjs/src/index.js not supported.
@connectrpc/connect-node:test:     Instead change the require of alloc.node.js in node_modules/uint8arraylist/dist/cjs/src/index.js to a dynamic import() which is available in all CommonJS modules.
@connectrpc/connect-node:test:   Stack:
@connectrpc/connect-node:test:     error properties: Object({ code: 'ERR_REQUIRE_ESM' })
@connectrpc/connect-node:test:         at Object.<anonymous> (node_modules/uint8arraylist/dist/cjs/src/index.js:87:17)
@connectrpc/connect-node:test:         at Object.<anonymous> (packages/connect/dist/cjs/protocol/async-iterable.js:65:26)
@connectrpc/connect-node:test:         at Object.<anonymous> (packages/connect/dist/cjs/callback-client.js:28:29)
@connectrpc/connect-node:test:         at Object.<anonymous> (packages/connect/dist/cjs/index.js:25:28)
@connectrpc/connect-node:test:         at Object.<anonymous> (packages/connect-node/dist/cjs/http2-session-manager.js:18:19)
@connectrpc/connect-node:test:         at Object.<anonymous> (packages/connect-node/dist/cjs/testdata/http2-session-manager-verify-ping.js:17:36)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant