From 9a8db156dca8f8a5387b71ecbf982c96cf3b3bd5 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 10 Mar 2022 23:17:14 -0800 Subject: [PATCH 1/3] add `widenClientFileUpload` option --- .../javascript/guides/nextjs/manual-setup.mdx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/platforms/javascript/guides/nextjs/manual-setup.mdx b/src/platforms/javascript/guides/nextjs/manual-setup.mdx index c18cf69c0066f..afc54ba88bafa 100644 --- a/src/platforms/javascript/guides/nextjs/manual-setup.mdx +++ b/src/platforms/javascript/guides/nextjs/manual-setup.mdx @@ -217,7 +217,6 @@ In that case you can also skip the `sentry-cli` configuration step below. ### Use `hidden-source-map` - _(New in version 6.17.1)_ 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 = { Note that this only applies to client-side builds, and requires the `SentryWebpackPlugin` to be enabled. +### Widen the Upload Scope + +_(New in version 6.18.3)_ + +If you find that there are in-app frames in your client-side stacktraces which aren't getting sourcemapped even when most others are, it is 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 nextjs or third-party code, and are named in such a way that it's hard to tell relevant files (ones containing your code) apart from irrelevant ones. + +To upload all of the files in `static/chunks/` anyway, add a `sentry` object to `moduleExports` above, and set the `widenClientFileUpload` option to `true`: + +```javascript {filename:next.config.js} +const moduleExports = { + sentry: { + widenClientFileUpload: true, + }, +}; +``` + ## Configure `sentry-cli` 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/). From 956e8a49390eff81e86bc1e8e29fbeccd2c6f88c Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Tue, 22 Mar 2022 12:09:53 -0700 Subject: [PATCH 2/3] code review fix --- src/platforms/javascript/guides/nextjs/manual-setup.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/javascript/guides/nextjs/manual-setup.mdx b/src/platforms/javascript/guides/nextjs/manual-setup.mdx index afc54ba88bafa..cd86f68ca5a0a 100644 --- a/src/platforms/javascript/guides/nextjs/manual-setup.mdx +++ b/src/platforms/javascript/guides/nextjs/manual-setup.mdx @@ -235,7 +235,7 @@ Note that this only applies to client-side builds, and requires the `SentryWebpa _(New in version 6.18.3)_ -If you find that there are in-app frames in your client-side stacktraces which aren't getting sourcemapped even when most others are, it is 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 nextjs or third-party code, and are named in such a way that it's hard to tell relevant files (ones containing your code) apart from irrelevant ones. +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. To upload all of the files in `static/chunks/` anyway, add a `sentry` object to `moduleExports` above, and set the `widenClientFileUpload` option to `true`: From 54447c4bf0da0c5b8487195455441cc358b90550 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Tue, 22 Mar 2022 12:14:14 -0700 Subject: [PATCH 3/3] fix version number --- src/platforms/javascript/guides/nextjs/manual-setup.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/javascript/guides/nextjs/manual-setup.mdx b/src/platforms/javascript/guides/nextjs/manual-setup.mdx index cd86f68ca5a0a..0fabeb1298ff9 100644 --- a/src/platforms/javascript/guides/nextjs/manual-setup.mdx +++ b/src/platforms/javascript/guides/nextjs/manual-setup.mdx @@ -233,7 +233,7 @@ Note that this only applies to client-side builds, and requires the `SentryWebpa ### Widen the Upload Scope -_(New in version 6.18.3)_ +_(New in version 6.19.1)_ 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.