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
Investigating how global error components and error fallbacks are implemented in the codebase.
- Assistant
Implementing server-side fallback when user
global-errorfails during render, and wrapping custom global-error boundaries with the built-in default on the client. - Assistant
Implemented last-resort handling when a custom
global-errorcomponent throws.Changes
-
app-page-global-error-boundary.ts
Shared helper that wraps a user-defined global error boundary in an outerErrorBoundarywhose fallback is the built-inDefaultGlobalError(aligned with Next.js’s outer root error boundary). Skipped when the app already uses the default module. -
app-page-route-wiring.tsx
Route trees usewrapWithNestedGlobalErrorBoundariesso client-side failures in customglobal-error.tsxfall back to the built-in UI. -
app-page-boundary-render.ts- RSC global-error wrappers use the same nested boundary via
wrapGlobalErrorBoundaryElement. renderAppPageErrorBoundary: if rendering the user’s global-error document fails during SSR (e.g. rejection), catch and re-render with , status , same middleware headers, (no original page error or broken global-error details), and no on the fallback pass.
- RSC global-error wrappers use the same nested boundary via
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.