Skip to main content

Component Boundary

Svelte's <svelte:boundary> catches runtime errors within a component tree and renders a fallback UI instead of crashing the entire page.

This component is alive and well.

BoundaryFallback Variants

The BoundaryFallback component accepts custom titles, descriptions, and minimum heights to fit different contexts.

Route Error Pages

SvelteKit errors that escape component boundaries are caught by +error.svelte pages. The system has three layers:

1. svelte:boundary Component-level — catches errors within a single component tree
2. +error.svelte Route-level — catches load/render errors for a route segment
3. error.html App-level — last resort when SvelteKit itself fails

Error Boundaries

Four +error.svelte files provide contextual recovery actions for each area:

routes/+error.svelte Root fallback — "Go home" action
routes/app/+error.svelte Authenticated area — "Back to dashboard" with sidebar visible
routes/auth/+error.svelte Auth flow — "Back to sign in" action
routes/showcases/+error.svelte Showcases — contextual hints per showcase category