Errors & boundaries
Errors & boundaries
Built-in NotFound, ErrorOverlay, ServerError exports plus manifest-driven ~404.tsx / ~500.tsx.
Errors & boundaries
Manic exposes three React primitives from manicjs for unmatched routes and thrown errors. Custom app/routes/~404.tsx / ~500.tsx files override the lazy loaders emitted inside app/~routes.generated.ts.
API reference
NotFound
Router no-match shell optional routes hints
ErrorOverlay
Development overlay with stack diagnostics
ServerError
Minimal fatal-error shell — no props
Manifest wiring (main.tsx)
import { routes, notFoundPage, errorPage } from './~routes.generated';
window.__MANIC_ROUTES__ = routes;
window.__MANIC_ERROR_PAGES__ = {};
if (notFoundPage) window.__MANIC_ERROR_PAGES__.notFound = notFoundPage;
if (errorPage) window.__MANIC_ERROR_PAGES__.error = errorPage;Error flow
Initializing diagram...
Route-level pages
| File | Purpose |
|---|---|
app/routes/~404.tsx | Custom not-found UI (export default) |
app/routes/~500.tsx | Custom error UI — receives framework-provided error props when routed via manifest |