'use client'; import { useEffect } from 'react'; import { useTranslations } from 'next-intl'; import { Button, Heading } from '@/components/ui'; import { Terminal, Activity, AlertTriangle, RefreshCw, Home, ShieldAlert } from 'lucide-react'; import { m } from 'framer-motion'; export default function Error({ error, reset, }: { error: Error & { digest?: string }; reset: () => void; }) { const t = useTranslations('Error'); useEffect(() => { // Force standard solid header document.body.setAttribute('data-header-variant', 'standard'); // Treat "Failed to find Server Action" as a deployment sync issue and reload if (error?.message?.includes('Failed to find Server Action')) { window.location.reload(); return; } console.error('Application error caught by boundary', { message: error?.message || 'Unknown error', stack: error?.stack, digest: error?.digest, }); return () => { document.body.removeAttribute('data-header-variant'); }; }, [error]); return (
{t('description')}