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

Support HTTP/2 (& consequently gRPC) #4414

Closed
liamwh opened this issue Aug 30, 2023 · 6 comments
Closed

Support HTTP/2 (& consequently gRPC) #4414

liamwh opened this issue Aug 30, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@liamwh
Copy link

liamwh commented Aug 30, 2023

What version of Bun is running?

0.8.1+16b4bf341acc0f4804f0b6bdf5298c180cd00366

What platform is your computer?

Darwin 22.6.0 arm64 arm

What steps can reproduce the bug?

Use gRPC with bufbuild connect. Some relevant packages include:

    "@bufbuild/buf": "^1.26.1",
    "@bufbuild/protobuf": "^1.3.0",
    "@bufbuild/protoc-gen-connect-es": "^0.8.6",
    "@bufbuild/protoc-gen-es": "^1.3.0",
    "@bufbuild/connect": "^0.13.0",
    "@bufbuild/connect-node": "^0.13.0",

I am using this lib if you want to attempt to replicate unfortunately I cannot share source code here: https://github.com/aserto-dev/node-directory

Then running:

❯ bun --bun run dev
In my package.json, I have tried setting the dev command to be both of the following, but both crash:

    "dev": "bunx --bun vite dev",
    "dev": "vite dev",

What is the expected behavior?

The server doesn't crash.

What do you see instead?

Internal server error: The "original" argument must be of type Function
      at promisify2 (node:util:365:99)
      at module code (/Users/myusernamehere/git/myproject/node_modules/.pnpm/@bufbuild+connect-node@0.13.0_@bufbuild+protobuf@1.3.0/node_modules/@bufbuild/con
nect-node/dist/esm/compression.js:27:31) (x3)
{"originalLine":365,"originalColumn":99}
error: "vite" exited with code 1 (SIGHUP)
error: script "dev" exited with code 1 (SIGHUP)

Additional information

  • Running with node my server does not crash.
  • I have also tried using both SvelteKit adapter Node and SvelteKit adapter bun. With both the issue still occurs.
@liamwh liamwh added the bug Something isn't working label Aug 30, 2023
@paperdave
Copy link
Member

paperdave commented Aug 30, 2023

can you open the second file in the stack trace, the one ending in .../esm/compression.js

and comment this line out
image

save and rebuild. promisify is throwing because the brotli compression isnt implemented at all and is undefined. if that is enough to get the build to work (as in, it doesnt ever try calling the compress and decompress function), we can define brotliDecompress as a function that throws just so this earlier error isnt hit.

otherwise, this will get resolved by #267

@utamori
Copy link

utamori commented Aug 31, 2023

connect-node depends on http2 and bun doesn't support http/2 yet, so it won't work anyway

@liamwh
Copy link
Author

liamwh commented Aug 31, 2023

Ok thanks, will stick with node until http/2 is supported. Is there any idea when that might be perhaps?

@cirospaciari cirospaciari self-assigned this Aug 31, 2023
@aralroca
Copy link
Contributor

connect-node depends on http2 and bun doesn't support http/2 yet, so it won't work anyway

I also hope that Bun supports HTTP/2 soon

@liamwh liamwh changed the title Crashes using gRPC (https://buf.build/) + Vite + SvelteKit Support HTTP/2 (& consequently gRPC) Sep 13, 2023
@thai-bug
Copy link

thai-bug commented Oct 5, 2023

I really hope http2 will be soon implemented. Cause of gRPC

@Electroid
Copy link
Contributor

We are working on this right now. Duplicate of #887

@Electroid Electroid closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants