Skip to content

feat(error): add global-error boundary for root layout crashes - #76

Merged
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
waterlemonnn:fix/global-error-boundary
Aug 8, 2026
Merged

feat(error): add global-error boundary for root layout crashes#76
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
waterlemonnn:fix/global-error-boundary

Conversation

@waterlemonnn

Copy link
Copy Markdown
Contributor

Closes #62.

There's no app/global-error.tsx, so if anything in the root layout itself throws, Next falls back to its built-in error page instead of app/error.tsx (which only catches errors below the root layout). In production that's a blank, unbranded page with no way back to the site.

This adds app/global-error.tsx following the acceptance criteria:

  • Renders its own <html>/<body> since it replaces the root layout
  • No imports from the component library or globals.css, everything inline-styled, so it can't itself fail for the same reason the layout did
  • Link back to the registry home and a mailto link to report the case, matching how the rest of the site handles contact (hello@agentpostmortem.com)

Verified locally by throwing in app/layout.tsx and running npm run dev — the request came back as a 500 that resolved to the app/global-error.js chunk instead of Next's default error page, then reverted the layout change.

@royalpinto007
royalpinto007 merged commit cdd1400 into AgentPostmortem:main Aug 8, 2026
11 checks passed
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

This is in, @waterlemonnn. Really appreciate it.

Contributions like this are what keep agentpostmortem moving.

A star on the repo would mean a lot if this project is useful to you.

Happy to see more from you whenever you have the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No app/global-error.tsx, so a root layout crash falls back to the default Next.js error page

2 participants