"use client"; // Error boundaries must be Client Components. import { useEffect } from "react"; import Link from "next/link"; // The editor had ZERO error boundaries: a throw anywhere in any page took out // the whole document and left a blank screen with nothing to click. This is the // backstop — it keeps the sidebar and chrome alive and gives the error a digest // you can match against the server log. // // Next 16.2 renamed the recovery prop: it is `unstable_retry`, which re-fetches // and re-renders the boundary's children. The older `reset` still exists but // only clears the error state WITHOUT re-fetching, which is almost never what // you want for a page that failed on a server read. // // Note this cannot catch a throw in the root layout itself (an error boundary // does not wrap the layout in its own segment) — that needs global-error.tsx, // which must render its own /. The root layout's work is small and // synchronous apart from the badge, which is wrapped in its own Suspense. export default function Error({ error, unstable_retry, }: { error: Error & { digest?: string }; unstable_retry: () => void; }) { useEffect(() => { console.error("[editor] route error", error); }, [error]); return (

This page didn’t load

Something threw while rendering. The rest of the editor is still running — the sidebar still works, and other pages are unaffected.

{error.digest && (

digest: {error.digest}{" "} (search the server log for this to find the stack)

)} {error.message && (
          {error.message}
        
)}
Back to dashboard
); }