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
Now check
mergeMiddlewareResponseHeadersto confirm cookie handling, then add tests: - Assistant
Now add the tests for the self-throwing global error component:
- Assistant
Let me clean up cruft I left in that last test:
- Assistant
All 21 pass. Now run the related test suites and the typecheck:
- Assistant
The real SSR path rejects on shell errors (
await renderToReadableStream), so the catch fires in production too. Now let me add an end-to-end compat test using the fixture app to validate the real pipeline: - Assistant
All 23 pass, including the new last-resort test against both dev and production preview. Let me run the remaining related suites and the repo checks:
- Assistant
All green. Here's a summary of the fix:
Problem
When
app/global-error.tsxitself threw while rendering,renderAppPageErrorBoundaryrejected (the SSR shell render fails,handleSsrrejects), the exception escaped every caller (buildAppPageElement, , the dispatch lifecycle), and the request ended with no last-resort UI.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.