fix: condition for sentry

This commit is contained in:
Torsten Dittmann
2024-06-26 14:05:31 +02:00
parent a4479416a6
commit 1a35189155
2 changed files with 4 additions and 4 deletions

View File

@@ -1,10 +1,10 @@
import { building } from '$app/environment'; import { dev } from '$app/environment';
import { SENTRY_DSN } from '$lib/constants'; import { SENTRY_DSN } from '$lib/constants';
import { handleErrorWithSentry, replayIntegration } from '@sentry/sveltekit'; import { handleErrorWithSentry, replayIntegration } from '@sentry/sveltekit';
import * as Sentry from '@sentry/sveltekit'; import * as Sentry from '@sentry/sveltekit';
Sentry.init({ Sentry.init({
enabled: building, enabled: !dev,
dsn: SENTRY_DSN, dsn: SENTRY_DSN,
tracesSampleRate: 1.0, tracesSampleRate: 1.0,

View File

@@ -3,10 +3,10 @@ import type { Handle } from '@sveltejs/kit';
import redirects from './redirects.json'; import redirects from './redirects.json';
import { sequence } from '@sveltejs/kit/hooks'; import { sequence } from '@sveltejs/kit/hooks';
import { BANNER_KEY, SENTRY_DSN } from '$lib/constants'; import { BANNER_KEY, SENTRY_DSN } from '$lib/constants';
import { building } from '$app/environment'; import { dev } from '$app/environment';
Sentry.init({ Sentry.init({
enabled: building, enabled: !dev,
dsn: SENTRY_DSN, dsn: SENTRY_DSN,
tracesSampleRate: 1 tracesSampleRate: 1
}) })