ErrorBoundary
Throw an error inside an island — get a pre-filled GitHub issue with stack trace, component path, URL, and UA.
stable client:visible
Rendered example — light + dark
Light
No error — click the button to trigger the boundary.
Dark
No error — click the button to trigger the boundary.
Recipes & props
A realistic usage snippet for this component. Imports come from
@/components/ui/….
See the
source
for the full API.
import ErrorBoundary from '@/components/islands/ErrorBoundary';
import RiskyIsland from '@/components/islands/RiskyIsland';
// On throw, builds a pre-filled GitHub issue: stack, component path, URL, UA.
export default function Wrapped() {
return (
<ErrorBoundary componentPath="src/components/islands/RiskyIsland.tsx">
<RiskyIsland />
</ErrorBoundary>
);
}