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 error-rendering paths, first checking the local Next.js reference tests/source as required, then add a focused regression test and implement the parity fix across relevant runtimes.
- Assistant
rgisn’t installed in this workspace, so I’m switching togit grep/find. The worktree appears clean from the initial status check. - Assistant
The reference clone isn’t present, but the repository’s installed Next.js package includes the authoritative server source. I found the likely vinext seam: rendering a selected global boundary can throw while producing its RSC/HTML response, and that exception currently escapes instead of switching to a static last-resort document. I’m checking Next’s equivalent catch behavior and exact fallback markup/status before changing it.
- Assistant
Next’s installed source confirms control-flow errors are classified before ordinary error fallback handling, and its global error is a distinct last-resort layer. I’m implementing the recovery only when the selected boundary is the root
global-error; local boundary failures will still propagate, and redirect/not-found-style signals from the global component will still propagate unchanged. The replacement render will use vinext’s built-in global error document with status 200 and the same middleware header/cookie merge path. - Assistant
The implementation and regression test are in place. The preferred
vpCLI isn’t installed in this environment, so I’m using the repository’s equivalent targetedpnpmtest command, then I’ll run focused type/lint checks. - Assistant
All 18 focused tests pass, including the new local-boundary and redirect-signal guards. The formatter found one style-only issue in the implementation; I’m applying the repository formatter to the two touched files and then rerunning checks.
- Assistant
The focused checks are clean. I also tightened the recovery so neither the route exception nor the global component’s own failure is passed into the last-resort RSC/dev-overlay payload; the fallback receives only a fixed opaque error. I’m running the adjacent App Router render/recovery tests now to catch integration regressions.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.