From 46b403f30f51e7f8e14f7bdc1680b5213b3a9899 Mon Sep 17 00:00:00 2001 From: neodk2004 Date: Mon, 10 Aug 2026 13:33:38 +0200 Subject: [PATCH] feat(observability): add global-error.tsx for Sentry App Router coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sentry's Next.js App Router setup requires this file to capture React rendering errors at the root layout level — GlitchTip's own setup checklist flagged it as missing. --- src/app/global-error.tsx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/app/global-error.tsx diff --git a/src/app/global-error.tsx b/src/app/global-error.tsx new file mode 100644 index 0000000..68e60d9 --- /dev/null +++ b/src/app/global-error.tsx @@ -0,0 +1,23 @@ +"use client"; + +import * as Sentry from "@sentry/nextjs"; +import NextError from "next/error"; +import { useEffect } from "react"; + +export default function GlobalError({ + error, +}: { + error: Error & { digest?: string }; +}) { + useEffect(() => { + Sentry.captureException(error); + }, [error]); + + return ( + + + + + + ); +}