Merged in fix/sentry-imports (pull request #3228)

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
This commit is contained in:
Linus Flood
2025-11-26 10:06:59 +00:00
parent a2d9010c8f
commit f70c431a5e
2 changed files with 4 additions and 4 deletions

View File

@@ -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"

View File

@@ -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",