Skip to content

refactor: move not-found to router default and add error boundary - #40

Merged
amrtgaber merged 1 commit into
mainfrom
refactor/router-error-boundary-defaults
May 19, 2026
Merged

refactor: move not-found to router default and add error boundary#40
amrtgaber merged 1 commit into
mainfrom
refactor/router-error-boundary-defaults

Conversation

@amrtgaber

Copy link
Copy Markdown
Contributor

Summary

  • Add an ErrorBoundary component and register it on the router via defaultErrorComponent. Previously uncaught errors in routes had no surface and rendered blank.
  • Register the not-found component on the router via defaultNotFoundComponent instead of on the root route — same reason: a boundary on __root.tsx is hosted inside the same route it protects.
  • The new error-boundary.tsx follows the template's minimal pattern (no @/lib/logger here, so just console.error). Visual style is plain — does not include the existing not-found.tsx AppLayout + Card chrome. Worth a future pass if you want them visually paired or if you want the boundary to preserve the app shell.

Test plan

  • pnpm dev — app boots normally
  • Visit a bogus path — 404 page renders (inside AppLayout per existing NotFound design)
  • Throw inside a route component — error page renders with "Try again" / "Go home" buttons
  • pnpm build and pnpm test:run both pass

Register the not-found component on the router via
defaultNotFoundComponent instead of on the root route, so it covers
errors thrown from the root route itself rather than being hosted
inside the same route it protects. Add an ErrorBoundary component
wired as defaultErrorComponent for the same reason — previously
uncaught errors had no surface and rendered as a blank page.
@netlify

netlify Bot commented May 19, 2026

Copy link
Copy Markdown

Deploy Preview for trove-web-production ready!

Name Link
🔨 Latest commit 57d9595
🔍 Latest deploy log https://app.netlify.com/projects/trove-web-production/deploys/6a0bef1ca37929000858a491
😎 Deploy Preview https://deploy-preview-40--trove-web-production.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@amrtgaber
amrtgaber merged commit 441ec59 into main May 19, 2026
6 checks passed
@amrtgaber
amrtgaber deleted the refactor/router-error-boundary-defaults branch May 19, 2026 05:05
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.

1 participant