You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Page reload causes stream/headers errors and crashes on clean Nuxt install #1081
Windows 11
Node 24 and 22
npm or bun
Nuxt 4 (reproduced on 4.0.0, 4.1.0 and 4.1.3)
Reproduction
Create a clean fresh empty Nuxt 4 project.
Run Nuxt in dev mode npm/bun dev, disable caching in browser options (not requried but helps to reproduce more reliably), start spamming page refresh command (Ctrl + R) and you will see errors in terminal.
Describe the bug
In dev mode (and only in dev) when refreshing the page Nuxt sometimes log stream errors:
I would just ignore them, but sometimes they crash the Nuxt entirely, triggering full restart (not just server but whole Nuxt):
nuxt-stream-bug.mp4
Additional context
Would not say it is critical, but indeed it is annoying and happens even without fast refreshing.
It also errors only in dev mode. In build or generate mode I did not manage to reproduce it no matter how fast I spam page refresh.
Also it seems I started to notice it only yersterday and fell like everything was alright before... Maybe have not noticed or did not payed attention earlier...
changed the title [-]Premature close / Cannot pipe to a closed or destroyed stream / Cannot set headers after they are sent to the client[/-][+]Page reload cause stream/headers errors and crashes on clean Nuxt install [/+]on Oct 9, 2025
changed the title [-]Page reload cause stream/headers errors and crashes on clean Nuxt install [/-][+]Page reload causes stream/headers errors and crashes on clean Nuxt install [/+]on Oct 9, 2025
Yeah, I spent all day yesterday debugging this.
I think it only happens on Windows. I don't have mac to test.
I managed to get rid of it by downgrading @nuxt/cli to 3.28.0.
in package.json
@SveinnB Cool, thanks for workaround and mentioning this is likely solving right now! I guess I will just wait for bug fix because it is not like critical for me.
Hey @Gwynerva, @SveinnB — just wanted to chime in since we were running into the same issue, and it seemed totally random. It only started after upgrading to Nuxt 4.1.3.
with the latest release. Makes Nuxt unusable for me at the moment. I'm trying to find a state to pin packages in order to get my dev setup working again.
Activity
[-]Premature close / Cannot pipe to a closed or destroyed stream / Cannot set headers after they are sent to the client[/-][+]Page reload cause stream/headers errors and crashes on clean Nuxt install [/+][-]Page reload cause stream/headers errors and crashes on clean Nuxt install [/-][+]Page reload causes stream/headers errors and crashes on clean Nuxt install [/+]SveinnB commentedon Oct 9, 2025
Yeah, I spent all day yesterday debugging this.
I think it only happens on Windows. I don't have mac to test.
I managed to get rid of it by downgrading @nuxt/cli to 3.28.0.
in package.json
I saw this issue nuxt/nuxt#33410 and tried this.
SveinnB commentedon Oct 9, 2025
This will probably be solved in next version of nuxt/cli
See @danielroe is working on this ...
4509643
Gwynerva commentedon Oct 9, 2025
@SveinnB Cool, thanks for workaround and mentioning this is likely solving right now! I guess I will just wait for bug fix because it is not like critical for me.
StirStudios commentedon Oct 9, 2025
Hey @Gwynerva, @SveinnB — just wanted to chime in since we were running into the same issue, and it seemed totally random. It only started after upgrading to Nuxt 4.1.3.
As soon as we applied @SveinnB’s workaround:
— the issue was resolved.
For context, we’re on macOS, using DDEV, and running pnpm and pm2 inside the container.
NtchPlayer commentedon Oct 9, 2025
Yes I got the same error on my application after upgrading to Nuxt 4.1.3.
Node v22.20.0
SveinnB commentedon Oct 9, 2025
Testing the new version 3.29.3

The "Cannot set headers ..." and "Cannot pipe to closed ..." are gone.
But the "Premature close" is still here
ahoiroman commentedon Oct 11, 2025
I got
with the latest release. Makes Nuxt unusable for me at the moment. I'm trying to find a state to pin packages in order to get my dev setup working again.
StirStudios commentedon Oct 11, 2025
@ahoiroman you need to pin your packages with this
shroomlife commentedon Oct 15, 2025
Same here with Bun 1.3 and Nuxt 4.1.3.
lauriscodes commentedon Oct 17, 2025
Can confirm that i have the same issue.
Seems like problem is persistent on windows machines only. I have got Windows 11.

Workaround which was suggested by @SveinnB definitely helps ! So, Thank You !
Vice-108 commentedon Oct 19, 2025
any fixes for windows 11 and npm
?