"use client"; import { useEffect } from "react"; /** * Last-resort boundary for errors thrown in the root layout itself * (before the locale layout / intl provider mount). It replaces the * entire document, so it must render its own /
and cannot * use translations or rely on the app stylesheet being applied — styles * are inlined with the palette's hex values so it renders correctly in * isolation. Everything below the locale layout is handled by * [locale]/error.tsx instead; this should almost never be seen. */ export default function GlobalError({ error, reset, }: { error: Error & { digest?: string }; reset: () => void; }) { useEffect(() => { console.error("Portal global error:", error); }, [error]); return (An unexpected error occurred. Please try again.
{error?.digest && ({error.digest}
)}