fix: disable Sentry webpack wrapper in dev mode
The withSentryConfig() wrapper caused recurring worker.js crashes in Next.js dev mode (vendor-chunks/lib/worker.js MODULE_NOT_FOUND). This crashed the server mid-request during image generation and other long-running operations. Fix: only apply withSentryConfig in production. In dev mode, use the raw Next.js config. Sentry instrumentation also gated to production only. Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -45,10 +45,12 @@ const nextConfig: NextConfig = {
|
||||
},
|
||||
};
|
||||
|
||||
export default withSentryConfig(nextConfig, {
|
||||
silent: true,
|
||||
sourcemaps: {
|
||||
disable: true,
|
||||
},
|
||||
telemetry: false,
|
||||
});
|
||||
// Only wrap with Sentry in production — the worker.js crash in dev mode
|
||||
// (vendor-chunks/lib/worker.js MODULE_NOT_FOUND) makes the dev server unstable
|
||||
export default process.env.NODE_ENV === "production"
|
||||
? withSentryConfig(nextConfig, {
|
||||
silent: true,
|
||||
sourcemaps: { disable: true },
|
||||
telemetry: false,
|
||||
})
|
||||
: nextConfig;
|
||||
|
||||
Reference in New Issue
Block a user