You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(nextjs): Widen scope for client file upload (#4705)
When nextjs builds an app, compiled versions of each page end up in `.next/static/chunks/pages`. In some circumstances, however, user-generated code ends up outside of `pages/`, and in those cases sourcemaps are broken because the relevant files aren't being uploaded.
This fixes that by optionally widening the scope of the upload, while excluding files known to contain only nextjs and webpack code. (Every build will generate other files which should be excluded, but there's no way to tell in advance what they're going to be called.) In order to reduce the number of irrelevant files being uploaded to Sentry, this behavior is off by default, but can be turned on with a new option `widenClientFileUpload`:
```
const { withSentryConfig } = require("@sentry/nextjs");
const moduleExports = {
sentry: {
widenClientFileUpload: true,
},
};
const sentryWebpackPluginOptions = {
// ...
};
module.exports = withSentryConfig(moduleExports, sentryWebpackPluginOptions);
```
This change is documented in getsentry/sentry-docs#4827.
Fixes#3896
0 commit comments