Skip to content

Commit 1de1fe8

Browse files
authored
chore(platform): Crash build on missing DSN (#13083)
1 parent 9e43ae3 commit 1de1fe8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

next.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ const outputFileTracingExcludes = process.env.NEXT_PUBLIC_DEVELOPER_DOCS
2323
'sitemap.xml': ['docs/**/*', 'public/mdx-images/**/*', '*.gif', '*.pdf', '*.png'],
2424
};
2525

26+
if (
27+
process.env.NODE_ENV !== 'development' &&
28+
(!process.env.NEXT_PUBLIC_SENTRY_DSN || !process.env.SENTRY_DSN)
29+
) {
30+
throw new Error(
31+
'Missing required environment variables: NEXT_PUBLIC_SENTRY_DSN and SENTRY_DSN must be set in production'
32+
);
33+
}
34+
2635
/** @type {import('next').NextConfig} */
2736
const nextConfig = {
2837
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],

0 commit comments

Comments
 (0)