Skip to content

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