A self-throwing global error component renders no last-resort UI If the global error…
- User
A self-throwing global error component renders no last-resort UI
If the global error component itself fails, return the built-in valid HTML fallback with the expected successful fallback status while preserving response headers and cookies. Local error boundaries and framework navigation/control-flow signals must retain their existing semantics, and the original boundary exception must not be exposed.
Interface
No new public interfaces are introduced.
- Assistant
I’ll trace the global-error rendering path and first compare it against the local Next.js reference tests/source, then add a focused regression test and patch the shared runtime path.
- Assistant
rgisn’t installed in this workspace, so I’m using scopedfind/grepsearches instead. The worktree is clean. - Assistant
The installed Next.js package confirms that the user global-error module is the final boundary component, while vinext currently has no recovery if that component fails. I’m narrowing the fix to the global-boundary render only: local boundaries remain untouched, and digest-based redirect/not-found/control-flow throws will continue propagating.
- Assistant
I’m adding regression coverage at the typed boundary renderer seam. The cases cover the successful built-in HTML recovery (including middleware headers and
Set-Cookie), plus explicit guards that local-boundary failures and navigation signals are not converted into the fallback. - Assistant
The Vite+ CLI isn’t installed on
PATHhere, so I’m using the repository’s targetedpnpm testcommand for the same Vitest file. - Assistant
The focused regression now passes. The recovery also buffers only the global-error HTML response so failures that occur during lazy stream consumption are caught before bytes escape; ordinary pages and local boundaries retain streaming behavior. I’m running the adjacent fallback suite and repository checks next.
- Assistant
The runtime tests pass, and the full check found only test-fixture typing: the deliberately throwing components were inferred as
voidcomponents. I’m adding explicit React return types and rerunning the check. - Assistant
One additional edge matters in React Server Components: render failures can be reported through the renderer’s
onErrorcallback while the stream itself closes normally. I’m covering that path too so an empty-but-“successful” stream cannot bypass the fallback.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.