remix-v2-error-boundaries-review
Installation
SKILL.md
Remix v2 Error Boundaries Code Review
Targets TypeScript route modules importing from @remix-run/*. No sibling
knowledge skill exists for this topic; the canonical mental model is
summarized inline below and expanded in references/.
v2 Boundary Model (read first)
Remix v2 unified v1's CatchBoundary + ErrorBoundary into a single
ErrorBoundary route-module export. The framework calls it for both
thrown Responses (e.g. throw new Response(...), throw json(...))
and thrown runtime errors (loader/action/render exceptions). Inside
the boundary you read the value with the useRouteError() hook, then
narrow in this order:
isRouteErrorResponse(error)→ it was a thrownResponse; readerror.status,error.statusText,error.data.error instanceof Error→ real runtime error; readerror.message.- else → unknown thrown value; render a generic fallback.