Repository navigation
Random NS_ERROR_NET_PARTIAL_TRANSFER in Mozilla Firefox #21574
Replies: 4 comments 3 replies
|
It is impossible to investigate without a reproduction. At least more information like detailed logs output by Firefox is required. |
|
I'm still trying to get some better data but I can echo most of the initial report. Node 22.22.0, Angular 21.0.6, Vite 7.2.2, SSL enabled, large projects failing to download chunks. Firefox transfers fail with NS_ERROR_NET_PARTIAL_TRANSFER while Chrome just keeps the transfers pending forever. |
|
I've had this issue for some time. See discussion here: Would be happy to provide logs if instructed how. |
|
This bugged us since we upgraded Vite in the past (the switch for Proxying with http/2 instead of http/1.1) and also affects Webkit (Safari) on iOS and Mac. Disclaimer: The following research and fix were done together with Claude Opus 5.5 Claude's SummaryWe're hitting the same bug (Angular 22 → `@angular/build` 22.1.8 → Vite 8.1.5, Firefox 153 and Safari, cold cache, ~250 modules on first load) and traced it down to the wire. Sharing in case it helps reopen this. Why it started with Vite 7.2#20869 (7.2.0) made the dev server use HTTP/2 even when What happens on the wireFirefox HTTP log ( The server sends the complete body, then On the server, Node considers every stream finished cleanly ( CauseNode's if (this.headersSent && this[kSession][kType] === NGHTTP2_SESSION_SERVER &&
!(state.flags & STREAM_FLAGS_HAS_TRAILERS) && !state.didRead &&
this.readableFlowing === null) {
setImmediate(callStreamClose, this); // → stream.close() → RST_STREAM(NO_ERROR)
}That reset can overtake the final Workaround (verified)Mark bodyless request streams as read so the graceful close never fires; the stream then closes normally after // packages/vite/src/node/http.ts → resolveHttpServer
const server = createSecureServer({ /* … */ allowHTTP1: true }, app)
server.on('stream', (stream) => {
if (stream.endAfterHeaders) stream.resume()
})
return server
Safari was also clean with the workaround. We ship it as a ReproductionWe couldn't reduce it to a standalone // Playwright, Firefox
for (let i = 0; i < 20; i++) {
const ctx = await browser.newContext({ ignoreHTTPSErrors: true })
const page = await ctx.newPage()
page.on('requestfailed', (r) => console.log(i, r.url(), r.failure()?.errorText))
await page.goto('https://localhost:4200/', { waitUntil: 'load' })
await page.waitForLoadState('networkidle')
await ctx.close()
}Since the root cause is Node's graceful close, the cleanest place for a fix may be Node itself, but the workaround is small and only affects bodyless requests on Vite's HTTP/2 server. @sapphi-red if this is enough for you to reproduce, I could provide a PR with the fix or you decide we should report this upstream. Hope the AI usage is okay, but without AI I couldn't have debugged this myself. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
When using Mozilla Firefox in my local Angular project I have a random network issue while loading the JS chunks: NS_ERROR_NET_PARTIAL_TRANSFER
It's working fine in Chrome or any other browsers.
The issue was introduced after upgrading my Angular project from v20 to v21. I confirmed the ViteJS lib was changed from 7.1.5 to 7.2.2. And also confirmed the issue is not reproducible when downgrading to Angular v20/Vite 7.1.5.
Vite version where the issue is not reproducible:
└─┬ @angular/build@20.3.3
├─┬ @vitejs/plugin-basic-ssl@2.1.0
│ └── vite@7.1.5 deduped
└── vite@7.1.5
Vite version with reproducible issue:
└─┬ @angular/build@21.0.5
├─┬ @vitejs/plugin-basic-ssl@2.1.0
│ └── vite@7.2.2 deduped
└── vite@7.2.2
Reproduction
n/a
Steps to reproduce
System Info
System: OS: macOS 26.2 CPU: (8) arm64 Apple M1 Pro Memory: 286.56 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.0.0 - /Users/name/.nvm/versions/node/v24.0.0/bin/node npm: 11.3.0 - /Users/name/.nvm/versions/node/v24.0.0/bin/npm pnpm: 9.12.1 - /opt/homebrew/bin/pnpm Browsers: Chrome: 144.0.7559.110 Edge: 144.0.3719.104 Safari: 26.2Used Package Manager
npm
Logs
No response
Validations
All reactions