diff --git a/apps/web/sentry.client.config.ts b/apps/web/sentry.client.config.ts index d571bc072c..bf1b468a5e 100644 --- a/apps/web/sentry.client.config.ts +++ b/apps/web/sentry.client.config.ts @@ -26,4 +26,14 @@ Sentry.init({ blockAllMedia: true, }), ], + beforeSend(event, hint) { + const error = hint.originalException as Error; + + // @ts-expect-error + if (error && error.digest === "NEXT_NOT_FOUND") { + return null; + } + + return event; + }, }); diff --git a/apps/web/sentry.server.config.ts b/apps/web/sentry.server.config.ts index 815b47c9e8..6b8a968318 100644 --- a/apps/web/sentry.server.config.ts +++ b/apps/web/sentry.server.config.ts @@ -11,4 +11,14 @@ Sentry.init({ // Setting this option to true will print useful information to the console while you're setting up Sentry. debug: false, + beforeSend(event, hint) { + const error = hint.originalException as Error; + + // @ts-expect-error + if (error && error.digest === "NEXT_NOT_FOUND") { + return null; + } + + return event; + }, });