Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.framework

Add a route-level error boundary for Next.js App Router segments

Next.js route segments should declare an error.tsx handler so async and client failures surface safely.

#Metadata

Rule ID
ts.react.no-missing-error-boundary
Severity
medium
Confidence
0.75
Languages
javascript, typescript
Presets
strict
Stability
experimental
Applies to
project
Tags
next, react, rules-catalog, ui

#Why it matters

Without a segment error boundary, failures in pages or layouts can crash the entire subtree without recovery UI.

#Remediation

Add error.tsx next to the segment’s page or layout, or hoist shared handling to a parent segment.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.react.no-missing-error-boundary.rule.yaml.