error-boundaries

Configure errorComponent and notFoundComponent for TanStack Router routes.

1|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/oakoss/open-saas-kit --skill error-boundaries-oakoss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-boundaries
Source: https://github.com/oakoss/open-saas-kit/tree/main/.claude/skills/error-boundaries
Command: npx skills add https://github.com/oakoss/open-saas-kit --skill error-boundaries-oakoss

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React applications frequently crash due to runtime errors, leading to broken UX. Error boundaries and fallback UIs prevent full crashes by gracefully displaying messages and recovery options.

Core Features & Use Cases

  • Route-level error boundaries via errorComponent to handle per-route failures with a custom UI.
  • Global error handling using defaultErrorComponent to provide a consistent fallback across the app.
  • Not Found handling patterns to gracefully display 404-like messages when data is missing.
  • Real-world scenario: A dashboard route crashes while loading data; display a friendly error and offer a retry mechanism.

Quick Start

Configure a route with an errorComponent and implement a simple Error UI that shows the error message and a reset button. Example: set errorComponent: MyErrorUI in your route config and implement MyErrorUI to render the error and call reset on retry.

Frequently Asked Questions about error-boundaries

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle route errors in TanStack Router without crashing the entire React app?

Handle route errors in TanStack Router by configuring an errorComponent in your route setup to catch failures and render a fallback UI instead of a full application crash.

What is the best way to display a 404 not found component for missing data in React?

Display a 404 not found message for missing data by implementing notFoundComponent patterns, which gracefully render fallback UIs when route loaders fail to find expected records.

How do I add a reset button to a React error boundary fallback UI?

Add a reset button to a React error boundary fallback UI by rendering a retry mechanism within your errorComponent that calls the provided reset function to clear the error state.

Does TanStack Router support global error handling for all routes?

TanStack Router supports global error handling by setting a defaultErrorComponent, which provides a consistent fallback UI across the entire application whenever route-specific errors occur.

Why does my dashboard route crash the UI when the data loader fails?

Dashboard route loaders without error boundaries crash the UI because runtime errors propagate upwards, but adding an errorComponent intercepts the failure to display a friendly message and retry option.