-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
libp2p package is not working with Bun #3877
Comments
Looks like this is because Bun is missing support for a Node.js feature: https://nodejs.org/api/util.html#custom-promisified-functions |
Also in /node_modules/@libp2p/crypto/dist/src/keys/ed25519.js:5:16 const keypair = promisify(crypto.generateKeyPair); Bun, doesn't support |
Any update on this? Having a similar issue on Bun 1.0.1 with the following code. import { createGrpcTransport } from '@bufbuild/connect-node'
createGrpcTransport({
httpVersion: '2',
baseUrl: 'http://127.0.0.1:8080',
}) ∨∨∨
|
I've never used libp2p, but a quick glance at the specs says it uses protobuf to describe the protocols used.
So possibly there's some gRPC in there which is built on top of HTTP2. According this this comment (in #4414), Bun does not support HTTP2 yet, which also explains why the code in my previous comment doesn't work as it uses @bufbuild/connect-node, a gRPC lib. |
Duplicate of #5122 |
What version of Bun is running?
0.7.1
What platform is your computer?
Linux 5.19.0-50-generic x86_64 x86_64
What steps can reproduce the bug?
I have installed libp2p, @libp2p/webtransport, @chainsafe/libp2p-noise packages with bun add command and I am trying to run following code with bun run index.js command
What is the expected behavior?
Code is working with Nodejs and it should run without error with Bun
What do you see instead?
Error message
Additional information
No response
The text was updated successfully, but these errors were encountered: