global-error.tsx
The error boundary for the root layout itself, which replaces the whole page when the root layout crashes.
In more detail
Because it replaces the root layout it must render its own html and body tags. It is rarely triggered, but it keeps the site from showing a blank page.
Related terms
- error.tsx — A special file that wraps a route segment in an error boundary and renders its component when something below it throws.
- root layout — The required top-level layout that wraps every route and must render the html and body tags.
Taught in
- Error Boundaries: Nested error.tsx & Reset Logic — Next.js 15 & Modern App Router Architecture