From 0ca2d0b6fd5f17ee20bcc2c788a99cb88c24a034 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Tue, 1 Oct 2024 17:12:43 +0100 Subject: [PATCH] chore: Exclude Sentry configs when not needed --- apps/web/instrumentation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/instrumentation.ts b/apps/web/instrumentation.ts index f8a929ba429a4d..b0bba123cc719d 100644 --- a/apps/web/instrumentation.ts +++ b/apps/web/instrumentation.ts @@ -1,9 +1,9 @@ export async function register() { - if (process.env.NEXT_RUNTIME === "nodejs") { + if (process.env.NEXT_PUBLIC_SENTRY_DSN && process.env.NEXT_RUNTIME === "nodejs") { await import("./sentry.server.config"); } - if (process.env.NEXT_RUNTIME === "edge") { + if (process.env.NEXT_PUBLIC_SENTRY_DSN && process.env.NEXT_RUNTIME === "edge") { await import("./sentry.edge.config"); } }