Hacker News new | ask | show | jobs
by herpderperator 787 days ago
Bun is amazing, but I recently tried to make an http/2 server through fastify and was not able to:

     user@host:~/d/temp/server$ bun run index_fastify.js
     14 |   warned.add(feature), console.warn(new NotImplementedError(feature, issue));
     15 | }, $;
     16 |
     17 | class NotImplementedError extends Error {
     18 |   code;
     19 |   constructor(feature, issue) {
                                    ^
     NotImplementedError: node:http2 createServer is not yet implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/887
      code: "ERR_NOT_IMPLEMENTED"

           at new NotImplementedError (internal:shared:19:27)
           at internal:shared:2:69
           at node:http2:48:53
           at getServerInstance (/Users/user/d/temp/server/node_modules/fastify/lib/server.js:342:16)
           at createServer (/Users/user/d/temp/server/node_modules/fastify/lib/server.js:25:18)
           at fastify (/Users/user/d/temp/server/node_modules/fastify/fastify.js:198:30)
           at /Users/user/d/temp/server/index_fastify.js:4:13
The linked issue is actually about implementing support for http/2 clients, which was already released in v1.0.13 (https://bun.sh/blog/bun-v1.0.13#http2-client-support). The NotImplementedError message should be updated to point to the issue for the server variant: https://github.com/oven-sh/bun/issues/8823

Implementing http/2 server support is in the top few feature requests (https://github.com/oven-sh/bun/issues?q=is%3Aissue+is%3Aopen...). It looks like once they ship this, a lot more people will be able to move over to Bun.

1 comments

That's just the status of Bun. Wait for implementations -> turns out you need more implementations of other APIs once that's done -> wait some more -> it comes out but will crash at various edge cases -> wait some more -> repeat. Bun is just too early in its lifecycle. Very hopeful for the project though!
Yes, but http2 is one of the few features Bun is missing. Overall it's pretty complete.