Skip to content

Error boundaries

@terra-symposium/error-boundaries provides a shared boundary lifecycle with React, Astro, and Next.js adapters. Import from the entry point matching your integration:

import { /* core exports */ } from '@terra-symposium/error-boundaries';
import { /* React exports */ } from '@terra-symposium/error-boundaries/react';
import { /* Astro exports */ } from '@terra-symposium/error-boundaries/astro';
import { /* Next.js exports */ } from '@terra-symposium/error-boundaries/next';

The root entry point exports ErrorBoundary, withErrorBoundary, and ErrorReporter for React, ErrorStatus, ERROR_STATUS_COPY, and errorStatusCopy() for Astro status copy, and NextRouteError, NextRouteErrorProps, and errorDigest() for Next.js route errors. React and React DOM 18+ are peer dependencies.

The application owns fallback UI, logging policy, and framework-specific deployment wiring. ErrorBoundary accepts optional fallback, name, resetKey, and onError props; withErrorBoundary() offers a component wrapper. Consult the installed declarations for exact types and behavior.