Skip to content

Commit 2146bf6

Browse files
committed
feat: attempt to fix sentry sourcemaps
1 parent 641531e commit 2146bf6

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

apps/frontend/next.config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const nextConfig = {
88
},
99
reactStrictMode: false,
1010
transpilePackages: ['crypto-hash'],
11+
// Enable production sourcemaps for Sentry
12+
productionBrowserSourceMaps: true,
1113
images: {
1214
remotePatterns: [
1315
{
@@ -42,9 +44,36 @@ const nextConfig = {
4244
];
4345
},
4446
};
47+
4548
export default withSentryConfig(nextConfig, {
4649
org: process.env.SENTRY_ORG,
4750
project: process.env.SENTRY_PROJECT,
4851
authToken: process.env.SENTRY_AUTH_TOKEN,
52+
53+
// Sourcemap configuration
54+
sourcemaps: {
55+
disable: false, // Enable sourcemap upload (default: false)
56+
assets: ["**/*.js", "**/*.js.map"], // Files to upload
57+
ignore: ["**/node_modules/**"], // Exclude node_modules
58+
deleteSourcemapsAfterUpload: true, // Delete sourcemaps after upload for security
59+
},
60+
61+
// Release configuration (optional but recommended)
62+
release: {
63+
create: true, // Create release in Sentry
64+
finalize: true, // Finalize release after build
65+
},
66+
67+
// Additional configuration
4968
telemetry: false,
69+
silent: process.env.NODE_ENV === 'production', // Reduce build logs in production
70+
debug: process.env.NODE_ENV === 'development', // Enable debug in development
71+
72+
// Error handling for CI/CD
73+
errorHandler: (error) => {
74+
console.warn("Sentry build error occurred:", error);
75+
// Don't fail the build if Sentry upload fails
76+
// Remove the next line if you want builds to fail on Sentry errors
77+
return;
78+
},
5079
});

0 commit comments

Comments
 (0)