Skip to content

Commit 256cf9f

Browse files
authored
fix(nextjs): Don't show warning about devtool option (#14552)
1 parent b0729b6 commit 256cf9f

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

packages/nextjs/src/config/webpack.ts

+1-10
Original file line numberDiff line numberDiff line change
@@ -336,20 +336,11 @@ export function constructWebpackConfigFunction(
336336

337337
if (sentryWebpackPlugin) {
338338
if (!userSentryOptions.sourcemaps?.disable) {
339-
// TODO(v9): Remove this warning
340-
if (newConfig.devtool === false) {
341-
const runtimePrefix = !isServer ? 'Client' : runtime === 'edge' ? 'Edge' : 'Node.js';
342-
// eslint-disable-next-line no-console
343-
console.warn(
344-
`[@sentry/nextjs - ${runtimePrefix}] You disabled sourcemaps with the Webpack \`devtool\` option. Currently, the Sentry SDK will override this option to generate sourcemaps. In future versions, the Sentry SDK will not override the \`devtool\` option if you explicitly disable it. If you want to generate and upload sourcemaps please set the \`devtool\` option to 'hidden-source-map' or undefined.`,
345-
);
346-
}
347-
348339
// TODO(v9): Remove this warning and print warning in case source map deletion is auto configured
349340
if (!isServer && !userSentryOptions.sourcemaps?.deleteSourcemapsAfterUpload) {
350341
// eslint-disable-next-line no-console
351342
console.warn(
352-
"[@sentry/nextjs] The Sentry SDK has enabled source map generation for your Next.js app. If you don't want to serve Source Maps to your users, either set the `deleteSourceMapsAfterUpload` option to true, or manually delete the source maps after the build. In future Sentry SDK versions `deleteSourceMapsAfterUpload` will default to `true`.",
343+
"[@sentry/nextjs] The Sentry SDK has enabled source map generation for your Next.js app. If you don't want to serve Source Maps to your users, either set the `deleteSourceMapsAfterUpload` option to true, or manually delete the source maps after the build. In future Sentry SDK versions `deleteSourceMapsAfterUpload` will default to `true`. If you do not want to generate and upload sourcemaps, set the `sourcemaps.disable` option in `withSentryConfig()`.",
353344
);
354345
}
355346

0 commit comments

Comments
 (0)