AEAl-Andalus⺢Experience
Sign in · Join
AEAl-Andalus⺢Experience
ProjectsGalleryAboutArticlesDashboardAPI
© 2026 — Modular content systems☕buy me a coffee
Framework Study Guide
ChaptersCardsLegendRoadmapRoute Map
Chapters
00 · Root Layout01 · Server Page (page.tsx)01a · Special Files (not-found, error, loading)02 · Client Component (UI & Interaction)02a · Client Boundaries & Islands03 · Entity Actions (actions/*.ts)04 · Server Actions ("use server")05 · Context Provider (context/*.tsx)06 · API Route (app/(api)/<entity>/route.ts)07 · TypeScript + Prisma08 · Entity-First Feature Design09 · Deployment, Docker & Cloud10 · Next 16 + Prisma 7 Upgrade11 · Prisma 7 (SQLite-first, App Router)12 · TypeORM (Entities + Migrations)13 · Drizzle ORM (SQL-first)11 · CSS, Mobile-First Flex, Tailwind12 · Libraries, Accelerators & Production Shortcuts14 · Next.js 16: cache, PPR, proxy, AI
→ cards/01a-special-files

Chapter

01a · Special Files (not-found, error, loading)

Route-level fallbacks: not-found.tsx, error.tsx, loading.tsx — declarative edge cases for every route segment.

Mental Model

  • Each route segment can own its fallback trio: no-data, error, loading.
  • They are co-located with the segment — never a global catch-all unless truly universal.
  • RSC streaming makes loading.tsx per-segment without extra effort.

not-found.tsx

  • Triggered when notFound() is called in a Server Page or action.
  • Scoped to the route segment — nested segments fall through to the nearest ancestor not-found.
  • Keep it specific: "Trip not found" vs "Page not found".

error.tsx

  • Client boundary that catches render-phase errors in the segment tree.
  • Must be a Client Component ("use client"). Exports error + reset().
  • Does NOT catch errors in layout.tsx of the same segment — layout errors bubble up.
  • Rule: log to console in dev, send to monitoring in prod; never display raw stack traces.

loading.tsx

  • Rendered while the segment's Server Page is awaiting promises (Suspense fallback).
  • Co-located loading states are automatic with the App Router — no manual Suspense boundaries needed for page-level.
  • Keep minimal: skeleton, spinner, or nothing (instant navigation).