'use client' import * as Sentry from '@sentry/nextjs' import NextError from 'next/error' import { useEffect, useRef } from 'react' // Relative import: the Sentry browser vitest project has no tsconfig path aliases import { reportGlobalCrashMetric } from '../lib/frontend-metrics' export default function GlobalError({ error }: { error: Error & { digest?: string } }) { const errorRef = useRef(null) useEffect(() => { errorRef.current?.focus() Sentry.captureException(error, { tags: { globalErrorBoundary: true } }) reportGlobalCrashMetric(error) }, [error]) return (
) }