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


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

FilePurpose
app/routes/~404.tsxCustom not-found UI (export default)
app/routes/~500.tsxCustom error UI — receives framework-provided error props when routed via manifest

See also

On this page