Repository navigation
Description
Every website e2e run logs 37-46 copies of ⨯ Error: The destination stream closed early., all with one digest. All 112 tests pass and no user-visible symptom exists. Filing so nobody re-derives this.
Cause — confirmed upstream and reproduced locally
A known, open Next.js regression: vercel/next.js#96704, reported against 16.3.1-canary.3 / react 19.2.8. Also #96465 (auto-closed for lacking a repro, not on the merits). Two fix PRs open, neither merged: #96715, #96717. No maintainer has commented on either thread.
A community bisection varying only next: 16.2.11 clean, 16.3.0 reproduces, 16.3.1-canary.9 still reproduces. 16.3.0 is where __NEXT_USE_NODE_STREAMS was switched on, routing RSC through pipeNodeReadableToNodeResponse. Verified in our own install:
dist/build/define-env.js:92— hardcodedtrue, no config opt-out.dist/server/pipe-readable.js:150-153—res.once('close', () => readable.destroy()), destroy with no reason.- React therefore synthesises
Error("The destination stream closed early."),name === "Error". dist/server/pipe-readable.js:32-34—isAbortErrormatches onnameonly (AbortError/ResponseAborted), so it does not silence it, andcreate-error-handler.jslogs it.
Why a completed response never logs it
From React's source (react-server-dom-turbopack-server.node.development.js): pipe() registers destination.on("close", createCancelHandler(...)) at :6954, and abort() at :4409 is guarded by if (!(11 < request.status)). Successful renders set status = CLOSED (14) before calling destination.end() (:4326). So the later close hits the guard and is a silent no-op.
Every occurrence therefore means a Flight render was still in progress when its socket closed. There is no benign-completion path.
Local proof
A logging reverse proxy in front of next start, correlating socket closes with in-flight renders:
| proxy behaviour | mid-stream client disconnects | errors | suite |
|---|---|---|---|
| pass through (destroy upstream) | 111 | 40 | 112/112 |
| absorb after headers | 67 absorbed, 42 destroyed pre-headers | 13 | 112/112 |
| absorb fully (drain, never destroy) | 103 absorbed | 0 | 112/112 |
Driving the early close to zero drives the error to zero. The aborted requests are overwhelmingly ?_rsc= prefetches of /docs/** — <Link> prefetches from the docs sidebar's 41 links, cancelled when Playwright tears a page down. /docs/[[...slug]] is the only request-time Flight render in a production build; everything else is prerendered.
Notably favicon.ico is a prerendered route handler, not a Flight render — the favicon test is implicated only by when it ends (immediately after waitForDocsReady, at the peak of the prefetch burst), not by what it fetches.
What we should do
Nothing, for now. There is no supported suppression: onRequestError is the only hook and we do not export one; the console line comes from Next's own logging with no documented filter. Pinning to 16.2.x would trade real fixes for log tidiness.
Watch vercel/next.js#96704 and drop this issue when it lands.
Related
#376 halves docs render time by removing a duplicate MDX+shiki compile. That narrows the window but does not fix this (34 lines after vs 37-46 before — noise).
Dead ends, so nobody repeats them
Each produced zero: complete HTML loads; complete RSC loads; curl aborts on both; Node socket-destroy on first byte across five route/mode combinations; real Chromium closing the context at 0/50/150/400/1200ms; cold vs warm server; hydration-then-teardown; prefetches allowed to settle; the query-stringed favicon URL repeated; request.get before page.goto. Patching Next's compiled runtime to log the request URL breaks it — destination is not bound at all three occurrences of the string; 30 tests fail. Use an external proxy instead.
Activity
blove commentedon Aug 14, 2026
Validated both upstream PRs against our own suite rather than waiting. Posted the numbers to vercel/next.js#96704.
Both PRs eliminate the error completely, and both preserve render cancellation.
closed earlyper suite runThe quiet re-run matters: the PR arms happened to run on a much less loaded machine, and lower load narrows the window a disconnect can land in. Re-measuring the unmodified baseline under the same quiet conditions still gave 28, so the zeros are the patches rather than the machine.
A second app checked what the error count cannot: a fix that simply stopped cancelling renders would also score zero, while quietly burning server time finishing responses nobody reads. Both PRs keep the cancellation and drop only the misreport, with a positive control confirming the check can fire.
Two things that change the advice in this issue:
dist, not the version string —isAbortErroris byte-identical to 16.3.0's name-only check and neither PR's marker is present. Notenext: "^16.3.0"means a barepnpm installmoves us to 16.3.1 silently; that is how this was found.Still nothing for us to do here beyond watching #96704. No local patch, no version pin.
Related: #376 halves docs render time, which narrows the window but does not fix this (34 lines after vs 37-46 before, i.e. noise).
docs: spec and plan for the upstream Next abort-fix validation (#402)
blove commentedon Aug 31, 2026
Rechecked 2026-08-30 from current
main(77e56cb0) against the shipped packages and the full production-mode browser suite.Upstream status — fix merged, but not in a stable release yet
Confirmed: vercel/next.js#96704 is now closed as completed. #96715 merged on 2026-08-26 as
0c7f81e6. #96717 was then closed as superseded by that shared-helper fix.The merged test is the contract we need: abort a streaming RSC response after its fallback arrives, assert that the client abort is not reported, then cause a genuine server render exception and assert that
onRequestErrorstill receivesserver-side-error. This is not string filtering and does not hide real rendering failures.Confirmed release state: npm's stable
latestis stillnext@16.3.3, published 2026-08-25 15:32 UTC — about 29 hours before the fix merged. There is no stable Next release containing the fix today. The first package I verified with the merged code is16.4.0-canary.9, published 2026-08-27 00:53 UTC.Shipped-artifact check, not version-name inference:
next@16.3.3and@next/mdx@16.3.3from declared ranges^16.3.3.16.3.3'sdist/server/app-render/stream-ops.node.jspipes to the PassThrough without the new close handler; itspipe-readable.jsstill calls barereadable.destroy()on response close.16.4.0-canary.9's published tarball contains the merged pre-pipept.once('close', ...)handler and callspipeable.abort(new ResponseAborted())when the destination closes beforewritableEnded.Disposition/judgment: do not move this production app to a 16.4 prerelease solely for log tidiness. That would take unrelated canary changes and bypass the repository's stable semver/Dependabot path. No dependency or workaround change is warranted yet.
Current reproduction and impact
Built the current website with Node 24.19.0 / pnpm 10.12.1 / Next 16.3.3, launched
next start, and ran the complete local production smoke against it:The count is timing- and workload-dependent and is higher than the original report because the suite has grown from 112 to 342 cases. The impact remains observability/log noise from client-cancelled in-flight RSC requests: the full Chromium/WebKit suite is green and no user-visible symptom was observed.
There is still no local workaround to remove: no
instrumentation/onRequestErrorexport, patched dependency, log-string suppression, blanket console filter, or error-name filter exists in the website.Exact unblock and recheck plan
Leave this open until npm publishes a stable
nextrelease (and matching@next/mdx) whose shippedstream-ops.node.jscontains the0c7f81e6abort-before-pipe fix. Do not infer inclusion from the version number or from #96704 being closed; inspect the published artifact.On the first stable release after
16.3.3:nextand@next/mdxtogether and inspect the installeddistfor the typed pre-pipe abort handler.onRequestErrorpath.The weekly dependency update should surface the next stable automatically; the recheck trigger is a stable npm version newer than 16.3.3, followed by artifact verification.
blove commentedon Aug 31, 2026
Rechecked 2026-08-31 after npm moved both
nextand@next/mdxstablelatestto16.3.4.The unblock condition is not met. I inspected the published
next-16.3.4.tgz(sha512-/Ztf6CeRH+ejEXUrYtqI4gkS66eFIHuSwqi60RgcpWKodxFZx2/dqVCMKBwILfAHXQ+F1b1vAudgj3mnxqtoIA==) and the authoritativev16.3.4tagged source, tag commit299180d3315c7ebd7b199d2b1a265b5986c5fc7d. Both still callpipeable.pipe(pt)immediately and omit the pre-pipe close listener,writableEndedcheck, andpipeable.abort(new ResponseAborted())added by0c7f81e6. GitHub comparison reports the fix commit and the 16.3.4 release tag as diverged, consistent with the artifact evidence.As a control, the published
16.4.0-canary.12artifact does contain that exactResponseAbortedpre-pipe handler. Therefore the fix remains canary-only despite the new stable patch release.No dependency/code change or PR was created: upgrading from 16.3.3 to 16.3.4 would not resolve the regression, and moving production to a canary or filtering the log would violate the safety constraints. This issue remains open. Recheck the next stable artifact; proceed only when it contains the upstream handler and a matching stable
@next/mdxis available.blove commentedon Sep 1, 2026
Status check (2026-09-01): upstream fix merged, but not in any 16.3.x
The premise here has not expired, so this stays open — but the closing condition is now exact.
vercel/next.js#96715 — "Don't report a client-aborted RSC stream as a render error" — merged 2026-08-26 into
canary(0c7f81e6), closing vercel/next.js#96704.It has not been backported to the 16.3 line. Verified by inspecting the shipped dist of each version rather than trusting version numbers, with a canary as a positive control so the check demonstrably distinguishes present from absent:
latest, released 2026-08-31)Grep marker:
pipeable.abort(new ResponseAborted()).So bumping within 16.3.x will not help. Closing condition: upgrade to 16.4.0 stable (or a 16.3.x that backports it), then confirm the occurrence count drops to 0.
Correction: we were watching the wrong file
This issue describes the cause as
pipe-readable.jsdoing a barereadable.destroy()with no reason. That is an accurate description of the mechanism, but it is the wrong place to watch for a fix — that line is unchanged even in canary (canary's only diff topipe-readable.tsis an unrelated compression/drain-listener leak fix). Anyone diffing that file across releases would conclude "still broken" indefinitely.The actual repair is 12 lines in
server/app-render/stream-ops.node.ts, insiderenderToNodeFlightStream:The listener is registered before piping, so it runs before React's. The abort then carries a reason instead of React's generic
Error, and the existing name-onlyisAbortErrormatches it correctly. That also explains whyisAbortErroritself was never changed — it did not need to be.One measurement trap
A recycled worktree had Next 16.3.0 installed while the lockfile resolves 16.3.3. Run
pnpm install --frozen-lockfilebefore inspecting, or you will read the wrong dist and draw a confident wrong conclusion.No behavior change on our side; still 0 user-visible symptoms and a green suite. Note this check was done by dist inspection, not by a fresh e2e run, so it does not restate a current occurrence count.
blove commentedon Nov 13, 2026
Resolved by #617 (Next.js 16.4.5), deployed as e17ab4f. Production /version.json reports that commit, and both the production deployment and freshness checks passed. The regression fixture reproduced two stream-closed errors on 16.3.3 and zero on 16.4.5 while preserving cancellation and genuine-error reporting. Hosted preview coverage passed 446 tests; a fresh live-production smoke run passed all 38 Chromium/WebKit cases. The production runtime-log query covering the smoke run returned zero matching destination-stream-closed errors (and no runtime entries in that window). This is bounded verification of the regression, not a claim that all future server errors are impossible.