Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.59.3
Framework Version
Next 13.4.9 / React 18.2.0
Link to Sentry event
No response
SDK Setup
Sentry.init({
dsn: ...,
tracesSampleRate: 1.0
});
Then in my next.config.js
:
const nextConfig = {
...
}
const sentryWebpackPluginOptions = {
org: ...,
project: ...,
authToken: ...,
sourcemaps: {
filesToDeleteAfterUpload: "*.map" // Also tried "**/*.map", ".next/**/*.map", even ".next/*"
}
};
module.exports = withSentryConfig(nextConfig, sentryWebpackPluginOptions)
Steps to Reproduce
- Add the above config to
next.config.js
- Run
next build
- Observe sourcemaps are still present in the
.next
outputs
Expected Result
Expected sourcemaps in the .next
outputs to have sourcemaps removed.
According to the docs, the package uses @sentry/webpack-plugin under the hood, which has a sourcemaps.filesToDeleteAfterUpload configuration option. But I wasn't able to get this working (see above next.config.js
attempts).
Actual Result
Sourcemaps are still present in the .next
outputs.
It appears the filesToDeleteAfterUpload
option isn't being respected, or I'm botching the config? If I'm looking at this correctly, the package uses an old version of the webpack plugin, which doesn't support that option. Is that the case? Would it be safe to upgrade this manually and set a yarn resolution? What is the recommended approach here?
Thank you
Metadata
Metadata
Assignees
Type
Projects
Status
Status