Impact: MEDIUM (prevents full-page crashes from isolated component failures)
Without error boundaries, a single thrown error in any component crashes the entire page. In Next.js App Router, error.tsx files act as error boundaries at the route segment level. For more granular control, wrap unreliable sections (third-party widgets, user-generated content, data-dependent components) so failures are contained.
Incorrect (no error boundaries — one failure kills the page):
// ❌ If AnalyticsChart throws, the entire dashboard crashesexport default async function DashboardPage() { const user = await fetchUser() const analytics = await fetchAnalytics() return ( <div> <UserHeader user={user} /> <AnalyticsChart data={analytics} /> {/* If this throws = blank page */} <RecentActivity /> </div> )}