nitrojs / nitrojs/nitro

Nitro Websocket issues when using Bun

Open
#3,007 3 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug v2
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

Environment

Operating System: Linux
Node Version: v22.12.0
Nuxt Version: 3.15.2
CLI Version: 3.20.0
Nitro Version: 2.10.4
Package Manager: bun@1.1.43
Builder: -
User Config: compatibilityDate, devtools
Runtime Modules: -
Build Modules: -

Reproduction

https://github.com/felixrydberg/bun-node-nitro-websocket-issue

Describe the bug

There is an issue when running Nitro with Bun. When using Node a catch all route will capture both Websocket and REST calls, while Bun will only capture REST calls.

Additional context

If anyone comes across this and the issue has been closed, there is also an issue on Buns github about this: https://github.com/oven-sh/bun/issues/16447

Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked bun-node-nitro-websocket-issue reproduction and run it under Bun and Node, focusing on the catch-all route's handling of WebSocket and REST requests. Compare the behavior with Nitro 2.10.4 and the related Bun issue; done means the catch-all route handles both request types consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, node.js, nuxt, typescript
Domain
api, backend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.