feat: attempt to fix sentry sourcemaps

This commit is contained in:
Nevo David 2025-08-01 20:23:12 +07:00
parent 641531e8b3
commit 2146bf626a
1 changed files with 29 additions and 0 deletions

View File

@ -8,6 +8,8 @@ const nextConfig = {
},
reactStrictMode: false,
transpilePackages: ['crypto-hash'],
// Enable production sourcemaps for Sentry
productionBrowserSourceMaps: true,
images: {
remotePatterns: [
{
@ -42,9 +44,36 @@ const nextConfig = {
];
},
};
export default withSentryConfig(nextConfig, {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
// Sourcemap configuration
sourcemaps: {
disable: false, // Enable sourcemap upload (default: false)
assets: ["**/*.js", "**/*.js.map"], // Files to upload
ignore: ["**/node_modules/**"], // Exclude node_modules
deleteSourcemapsAfterUpload: true, // Delete sourcemaps after upload for security
},
// Release configuration (optional but recommended)
release: {
create: true, // Create release in Sentry
finalize: true, // Finalize release after build
},
// Additional configuration
telemetry: false,
silent: process.env.NODE_ENV === 'production', // Reduce build logs in production
debug: process.env.NODE_ENV === 'development', // Enable debug in development
// Error handling for CI/CD
errorHandler: (error) => {
console.warn("Sentry build error occurred:", error);
// Don't fail the build if Sentry upload fails
// Remove the next line if you want builds to fail on Sentry errors
return;
},
});