Skip to main content

shadcn-sandbox

Playground components

ErrorOverlay

Runtime error overlay with stack trace, open file, and copy actions.

bunx --bun shadcn@latest add https://shadcn-sandbox.vercel.app/r/error-overlay.json

Preview

Runtime Error

Cannot read properties of undefined (reading 'count')

components/counter.tsx:14:5

TypeError: Cannot read properties of undefined (reading 'count')
    at Counter (components/counter.tsx:14:5)
    at renderWithHooks (react-dom/cjs/react-dom.development.js:15486:18)
    at mountIndeterminateComponent (react-dom/cjs/react-dom.development.js:20103:13)
    at beginWork (react-dom/cjs/react-dom.development.js:21626:16)
import { ErrorOverlay } from "@/components/sandbox/error-overlay";

export function PreviewError({ error }: { error: RuntimeError }) {
  return (
    <ErrorOverlay
      error={error}
      onOpenFile={openErrorFile}
      onCopy={copyErrorToClipboard}
      onDismiss={dismissError}
    />
  );
}