Files
EpicNext-Cms/sentry.server.config.ts
T
openhands 0d6032d444
CI / check (push) Successful in 23s
CI / release (push) Skipped
CI / deploy (push) Successful in 1m15s
chore: remove standalone output mode, fix Sentry DSN validation, add dev CSP unsafe-inline for styles
- Remove output: 'standalone' from next.config.ts to allow normal 'next start'
- Allow empty SENTRY_DSN/NEXT_PUBLIC_SENTRY_DSN in env validation (zod)
- Add 'unsafe-inline' to style-src CSP only in development for Turbopack HMR
- Clear placeholder Sentry DSN values from .env
2026-08-01 21:30:51 +02:00

24 lines
593 B
TypeScript

import * as Sentry from "@sentry/nextjs";
import { redactSentryEvent } from "@/lib/sentry-redact";
const dsn = process.env.SENTRY_DSN;
if (dsn) {
Sentry.init({
dsn,
environment: process.env.NODE_ENV,
release: process.env.APP_VERSION,
tracesSampleRate: process.env.NODE_ENV === "production" ? 0.1 : 1.0,
enabled: process.env.NODE_ENV === "production",
ignoreErrors: [
"Network request failed",
"AbortError",
"NEXT_REDIRECT",
"NEXT_NOT_FOUND",
"UnrecognizedActionError",
"Server Action.*was not found on the server",
],
beforeSend: redactSentryEvent,
});
}