From f70c431a5e1ac84a8b9aec5f4a4cb2571711daff Mon Sep 17 00:00:00 2001 From: Linus Flood Date: Wed, 26 Nov 2025 10:06:59 +0000 Subject: [PATCH] Merged in fix/sentry-imports (pull request #3228) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat(sentry): changed imports so they work in netlify functions * feat(sentry): changed imports so they work in netlify functions Approved-by: Joakim Jäderberg --- apps/scandic-web/netlify/functions/warmup-background.mts | 2 +- apps/scandic-web/netlify/utils/initSentry.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/scandic-web/netlify/functions/warmup-background.mts b/apps/scandic-web/netlify/functions/warmup-background.mts index 40eec84c1..7d3014590 100644 --- a/apps/scandic-web/netlify/functions/warmup-background.mts +++ b/apps/scandic-web/netlify/functions/warmup-background.mts @@ -1,6 +1,6 @@ import crypto from "node:crypto" -import * as Sentry from "@sentry/nextjs" +import Sentry from "@sentry/nextjs" import jwt from "jsonwebtoken" import { type WarmupFunctionsKey } from "@/services/warmup/warmupKeys" diff --git a/apps/scandic-web/netlify/utils/initSentry.ts b/apps/scandic-web/netlify/utils/initSentry.ts index 123b2dd23..fc56fb406 100644 --- a/apps/scandic-web/netlify/utils/initSentry.ts +++ b/apps/scandic-web/netlify/utils/initSentry.ts @@ -1,16 +1,16 @@ -import * as Sentry from "@sentry/nextjs" +import { captureRequestError, init as sentryInit } from "@sentry/nextjs" export const denyUrls: (string | RegExp)[] = [ // Ignore preview urls /\/.{2}\/preview\//, ] -export const onRequestError = Sentry.captureRequestError +export const onRequestError = captureRequestError export async function configureSentry() { const sentryEnvironment = Netlify.env.get("SENTRY_ENVIRONMENT") const sampleRate = Number(Netlify.env.get("SENTRY_SERVER_SAMPLERATE") ?? 0.01) - Sentry.init({ + sentryInit({ dsn: "https://fe39c070b4154e2f9cc35f0e5de0aedb@o4508102497206272.ingest.de.sentry.io/4508102500286544", environment: sentryEnvironment, enabled: sentryEnvironment !== "development",