From 0d6032d4441306fd69feb14fa3fcb194d5a8b019 Mon Sep 17 00:00:00 2001 From: openhands Date: Sat, 1 Aug 2026 21:30:51 +0200 Subject: [PATCH] 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 --- next.config.ts | 3 --- sentry.server.config.ts | 2 ++ src/env.ts | 4 ++-- src/lib/csp.ts | 1 + 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/next.config.ts b/next.config.ts index a4220543..aa9192e7 100644 --- a/next.config.ts +++ b/next.config.ts @@ -32,9 +32,6 @@ const nextConfig: NextConfig = { // Disable Next.js telemetry and browser sourcemaps in production productionBrowserSourceMaps: false, - // Standalone output for smaller, faster Docker deployments and cold starts - output: "standalone", - experimental: { useTypeScriptCli: true, }, diff --git a/sentry.server.config.ts b/sentry.server.config.ts index 5c72021c..e51d761b 100644 --- a/sentry.server.config.ts +++ b/sentry.server.config.ts @@ -15,6 +15,8 @@ if (dsn) { "AbortError", "NEXT_REDIRECT", "NEXT_NOT_FOUND", + "UnrecognizedActionError", + "Server Action.*was not found on the server", ], beforeSend: redactSentryEvent, }); diff --git a/src/env.ts b/src/env.ts index 58f1a4d9..e95c35db 100644 --- a/src/env.ts +++ b/src/env.ts @@ -92,8 +92,8 @@ const schema = z // Logging level. LOG_LEVEL: z.enum(["debug", "info", "warn", "error"]).optional(), // Optional Sentry — no-op when unset. - SENTRY_DSN: z.string().url().optional(), - NEXT_PUBLIC_SENTRY_DSN: z.string().url().optional(), + SENTRY_DSN: z.string().url().optional().or(z.literal("")), + NEXT_PUBLIC_SENTRY_DSN: z.string().url().optional().or(z.literal("")), SENTRY_ORG: z.string().optional(), SENTRY_PROJECT: z.string().optional(), SENTRY_AUTH_TOKEN: z.string().optional(), diff --git a/src/lib/csp.ts b/src/lib/csp.ts index c5a711e6..092bf27c 100644 --- a/src/lib/csp.ts +++ b/src/lib/csp.ts @@ -20,6 +20,7 @@ export function buildContentSecurityPolicy(nonce: string): string { "'self'", `'nonce-${nonce}'`, "https://fonts.googleapis.com", + ...(isDev ? ["'unsafe-inline'"] : []), ].join(" "); return [