[!NOTE]
I could not create a reproduction in Stackblitz/CodeSandbox, as I couldn't figure out how to use Bun there. Therefore, I created a repo instead. Make sure to read the README for reproduction steps.
Describe the bug
I ran into some crashes while using SSE and I think it has something to do with Nitro preset bun. I'm using a Nuxt application built with Nitro preset bun. I tried building the app in two different ways to check for differences, but both builds behave the same way:
Using NITRO_PRESET=bun bun --bun run build
Using the nitro.preset setting in nuxt.config.ts set to bun
The crash occurs when a frontend closes an SSE connection with the Nuxt app. It only crashes when using the bun Nitro preset. With the node-server preset, no issues arise. Also, when running the Nuxt app with bun --bun run dev with the Nitro bun preset, this crash does not occur upon closing an SSE connection.
Additional context
Bun revision:1.1.27+267afa293Platform:Linux 6.8.0-40-generic x86_64 x86_64.
If this is a Nuxt issue, feel free to transfer the issue to the Nuxt repository.
Environment
Build Modules: -
Reproduction
https://github.com/Anoesj/nitro-bun-sse-issue
Describe the bug
I ran into some crashes while using SSE and I think it has something to do with Nitro preset
bun
. I'm using a Nuxt application built with Nitro presetbun
. I tried building the app in two different ways to check for differences, but both builds behave the same way:NITRO_PRESET=bun bun --bun run build
nitro.preset
setting innuxt.config.ts
set tobun
The crash occurs when a frontend closes an SSE connection with the Nuxt app. It only crashes when using the
bun
Nitro preset. With thenode-server
preset, no issues arise. Also, when running the Nuxt app withbun --bun run dev
with the Nitrobun
preset, this crash does not occur upon closing an SSE connection.Additional context
Bun revision:
1.1.27+267afa293
Platform:Linux 6.8.0-40-generic x86_64 x86_64
.If this is a Nuxt issue, feel free to transfer the issue to the Nuxt repository.