Skip to content

Commit 4bd0dd0

Browse files
authored
ref(nextjs): Add note about upcoming default hideSourceMaps value (#5464)
This expands the explanation of the `hideSourceMaps` option in `next.config.js`, and notes that it will default to `true` starting in version 8 of the SDK. In conjunction with getsentry/sentry-javascript#5649, getsentry/sentry-wizard#188, and vercel/next.js#40079, this is the first step in addressing the concerns raised in getsentry/sentry-javascript#4489. See getsentry/sentry-javascript#4489 (comment) for more details.
1 parent 30f4c5b commit 4bd0dd0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/platforms/javascript/guides/nextjs/manual-setup.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ In that case you can also skip the `sentry-cli` configuration step below.
244244

245245
### Use `hidden-source-map`
246246

247-
_(New in version 6.17.1)_
247+
_(New in version 6.17.1, will default to `true` in 8.0.0 and beyond.)_
248248

249-
If you would like to use `hidden-source-map` rather than `source-map` as your webpack `devtool`, so that your built files do not contain a `sourceMappingURL` comment, add a `sentry` object to `moduleExports` above, and set the `hideSourceMaps` option to `true`:
249+
Depending on your deployment setup, adding `sentry/nextjs` to your app may cause your source code to be visible in browser devtools when it wasn't before. (This happens because of the default behavior of [Webpack's `source-map` built-in `devtool`](https://webpack.js.org/configuration/devtool/).) To prevent this, you can use `hidden-source-map` rather than `source-map`, which will prevent your built files from containing a `sourceMappingURL` comment, thus making sourcemaps invisible to the browser. To use `hidden-source-map`, add a `sentry` object to `moduleExports` above, and set the `hideSourceMaps` option to `true`:
250250

251251
```javascript {filename:next.config.js}
252252
const moduleExports = {
@@ -256,7 +256,7 @@ const moduleExports = {
256256
};
257257
```
258258

259-
Note that this only applies to client-side builds, and requires the `SentryWebpackPlugin` to be enabled.
259+
Note that this only applies to client-side builds, and requires the `SentryWebpackPlugin` to be enabled. This option will default to `true` starting in version 8.0.0. See https://webpack.js.org/configuration/devtool/ for more information.
260260

261261
### Widen the Upload Scope
262262

0 commit comments

Comments
 (0)