All checks were successful
CI / skip-ci-check (pull_request) Successful in 1m22s
CI / lint-and-type-check (pull_request) Successful in 1m46s
CI / test (pull_request) Successful in 1m51s
CI / build (pull_request) Successful in 1m51s
CI / secret-scanning (pull_request) Successful in 1m22s
CI / dependency-scan (pull_request) Successful in 1m28s
CI / sast-scan (pull_request) Successful in 2m24s
CI / workflow-summary (pull_request) Successful in 1m21s
- Introduced a minimal global error boundary to handle errors during prerendering. - Provides a simple UI for error display and a retry action without relying on contexts.
35 lines
887 B
TypeScript
35 lines
887 B
TypeScript
"use client"
|
|
|
|
// Minimal global error boundary to avoid hook usage on missing providers during prerender.
|
|
// Does not rely on any contexts; renders a simple retry action.
|
|
export default function GlobalError({
|
|
error,
|
|
reset,
|
|
}: {
|
|
error: Error & { digest?: string }
|
|
reset: () => void
|
|
}) {
|
|
return (
|
|
<html>
|
|
<body>
|
|
<main style={{ padding: "2rem", fontFamily: "sans-serif" }}>
|
|
<h1>Something went wrong</h1>
|
|
<p>{error.message || "An unexpected error occurred."}</p>
|
|
{error.digest ? <p>Reference: {error.digest}</p> : null}
|
|
<button
|
|
type="button"
|
|
onClick={reset}
|
|
style={{
|
|
marginTop: "1rem",
|
|
padding: "0.5rem 1rem",
|
|
cursor: "pointer",
|
|
}}
|
|
>
|
|
Try again
|
|
</button>
|
|
</main>
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|