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 App Router global-error fallback path, first checking the local Next.js reference tests/source as required, then add a focused regression test and fix both relevant runtime paths.
- Assistant
The required local Next.js checkout is absent, and
rgis unavailable; I won’t fetch it because this task explicitly forbids external sources. I’m continuing with the repository’s own compatibility tests and implementation using localfind/grep. - Assistant
The failure sits in the shared App Router boundary renderer. I’m adding a one-time retry with vinext’s built-in global error module only when the selected boundary was the global boundary; local-boundary failures and redirect/not-found/access signals will continue to propagate unchanged. The retry reuses the middleware response context, so headers and
Set-Cookiesurvive. - Assistant
vpis not installed in this environment, so I’m using the repository’s equivalent targetedpnpm testcommand. - Assistant
The focused behavior tests pass. Formatting found one mechanical issue in the new test; I’m applying the repository formatter to the two touched files, then rerunning tests and type-aware lint.
- Assistant
The regression and adjacent boundary/stream suites now pass (60 tests total). The fallback returns 200, retains middleware headers and cookies, renders the built-in valid document, hides both the page and self-throw messages, and leaves local/control-flow failures untouched.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.