Skip to content

Commit a06ad22

Browse files
authored
feat(nextjs): Add widenClientFileUpload option (#4827)
This documents the option added in getsentry/sentry-javascript#4705, which allows users to choose to cast a wider net when uploading sourcemaps for client-side code.
1 parent 653f750 commit a06ad22

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ In that case you can also skip the `sentry-cli` configuration step below.
217217

218218
### Use `hidden-source-map`
219219

220-
221220
_(New in version 6.17.1)_
222221

223222
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`:
@@ -232,6 +231,22 @@ const moduleExports = {
232231

233232
Note that this only applies to client-side builds, and requires the `SentryWebpackPlugin` to be enabled.
234233

234+
### Widen the Upload Scope
235+
236+
_(New in version 6.19.1)_
237+
238+
If you find that there are in-app frames in your client-side stack traces that aren't getting source-mapped even when most others are, it's likely because they are from files in `static/chunks/` rather than `static/chunks/pages/`. By default, such files aren't uploaded because the majority of the files in `static/chunks/` only contain Next.js or third-party code, and are named in such a way that it's hard to distinguish between relevant files (ones containing your code) and irrelevant ones.
239+
240+
To upload all of the files in `static/chunks/` anyway, add a `sentry` object to `moduleExports` above, and set the `widenClientFileUpload` option to `true`:
241+
242+
```javascript {filename:next.config.js}
243+
const moduleExports = {
244+
sentry: {
245+
widenClientFileUpload: true,
246+
},
247+
};
248+
```
249+
235250
## Configure `sentry-cli`
236251

237252
The `SentryWebpackPlugin` uses `sentry-cli` to manage releases and source maps, which can be configured in one of two ways - using configuration files, or with environment variables - both of which are discussed below. For full details, see [the CLI configuration docs](/product/cli/configuration/).

0 commit comments

Comments
 (0)