router-core/not-found-and-errors

Installation
SKILL.md

Not Found and Errors

TanStack Router handles two categories of "not found": unmatched URL paths (automatic) and missing resources like a post that doesn't exist (manual via notFound()). Error boundaries are configured per-route via errorComponent.

CRITICAL: Do NOT use the deprecated NotFoundRoute. When present, notFound() and notFoundComponent will NOT work. Remove it and use notFoundComponent instead. CRITICAL: useLoaderData may be undefined inside notFoundComponent. Use useParams, useSearch, or useRouteContext instead.

Not Found Handling

Global 404: notFoundComponent on Root Route

// src/routes/__root.tsx
import { createRootRoute, Outlet, Link } from '@tanstack/react-router'
Installs
GitHub Stars
16
First Seen
router-core/not-found-and-errors — lightfastai/lightfast