Skip to content

feat: add polished error handling pages (error, not-found, global-error)#6

Open
akhil05-g wants to merge 1 commit into
redpangilinan:mainfrom
akhil05-g:main
Open

feat: add polished error handling pages (error, not-found, global-error)#6
akhil05-g wants to merge 1 commit into
redpangilinan:mainfrom
akhil05-g:main

Conversation

@akhil05-g

Copy link
Copy Markdown

feat: add polished error handling pages

What this PR adds
Three new files under src/app/ to cover all Next.js 14 app router error surface areas:

File Handles
error.tsx Runtime errors within a route segment
not-found.tsx 404s from notFound() or unknown routes
global-error.tsx Errors thrown inside the root layout.tsx

Why it belongs in this template

The template is described as "ready to use — jump right into development." Error boundaries are a production requirement, not an afterthought — but Next.js does not scaffold them by default. Adding them here means every project started from this template has a safe, consistent error UX from day one.

Design decisions

  • error.tsx and not-found.tsx use shadcn/ui components (Button, Separator) and Tailwind classes so they inherit any theme customizations automatically.
  • global-error.tsx uses inline styles intentionally — because it replaces the root layout entirely, Tailwind and the global CSS file are unavailable at that point.
  • The error.digest value is surfaced (when present) to aid debugging in production without exposing a raw stack trace.
  • Icons are sourced from lucide-react, already a dependency of shadcn/ui.

Checklist

  • No new dependencies added
    -TypeScript strict-compatible
  • Follows existing file structure (src/app/)
  • Consistent with shadcn/ui design language
  • global-error.tsx correctly includes <html> and <body> per Next.js requirements

@vercel

vercel Bot commented Mar 4, 2026

Copy link
Copy Markdown

@Akhil200519 is attempting to deploy a commit to the redpangilinan's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

2 participants