Title: @sentry/nextjs doesn't respect sourcemaps.filesToDeleteAfterUpload · Issue #8600 · getsentry/sentry-javascript · GitHub
Open Graph Title: @sentry/nextjs doesn't respect sourcemaps.filesToDeleteAfterUpload · Issue #8600 · getsentry/sentry-javascript
X Title: @sentry/nextjs doesn't respect sourcemaps.filesToDeleteAfterUpload · Issue #8600 · getsentry/sentry-javascript
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/...
Open Graph 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 th...
X 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 th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/8600
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@sentry/nextjs doesn't respect sourcemaps.filesToDeleteAfterUpload","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [X] I have reviewed the documentation https://docs.sentry.io/\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/nextjs\n\n### SDK Version\n\n7.59.3\n\n### Framework Version\n\nNext 13.4.9 / React 18.2.0\n\n### Link to Sentry event\n\n_No response_\n\n### SDK Setup\n\n```\r\nSentry.init({\r\n dsn: ...,\r\n tracesSampleRate: 1.0\r\n});\r\n```\r\n\r\nThen in my `next.config.js`:\r\n\r\n```\r\nconst nextConfig = {\r\n ...\r\n}\r\n\r\nconst sentryWebpackPluginOptions = {\r\n org: ...,\r\n project: ...,\r\n authToken: ...,\r\n sourcemaps: {\r\n filesToDeleteAfterUpload: \"*.map\" // Also tried \"**/*.map\", \".next/**/*.map\", even \".next/*\"\r\n }\r\n};\r\n\r\nmodule.exports = withSentryConfig(nextConfig, sentryWebpackPluginOptions)\r\n```\n\n### Steps to Reproduce\n\n1. Add the above config to `next.config.js`\r\n2. Run `next build`\r\n3. Observe sourcemaps are still present in the `.next` outputs\n\n### Expected Result\n\nExpected sourcemaps in the `.next` outputs to have sourcemaps removed.\r\n\r\nAccording to [the docs](https://docs.sentry.io/platforms/javascript/guides/nextjs/sourcemaps/), the package uses [@sentry/webpack-plugin](https://www.npmjs.com/package/@sentry/webpack-plugin) under the hood, which has a [sourcemaps.filesToDeleteAfterUpload](https://www.npmjs.com/package/@sentry/webpack-plugin#sourcemapsfilestodeleteafterupload) configuration option. But I wasn't able to get this working (see above `next.config.js` attempts).\n\n### Actual Result\n\nSourcemaps are still present in the `.next` outputs.\r\n\r\nIt 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](https://github.com/getsentry/sentry-javascript/blob/develop/packages/nextjs/package.json#L34) 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?\r\n\r\nThank you","author":{"url":"https://github.com/joeldotsh","@type":"Person","name":"joeldotsh"},"datePublished":"2023-07-20T21:51:05Z","url":"https://github.com/getsentry/sentry-javascript/issues/8600"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:76130266-5caf-16b8-53ee-59e0d974809a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D4EA:10C6A:7A37C6:A143E8:6B04CA6D |
| html-safe-nonce | d67e5de97123b5402a4edf1b217eecf06b468990af4eedb8b756fba21df242a2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENEVBOjEwQzZBOjdBMzdDNjpBMTQzRTg6NkIwNENBNkQiLCJ2aXNpdG9yX2lkIjoiMzQ3ODczNzQ2NjQ1NzExNTI0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c418a8f5b3ae35965ea26755359f211d38ad8a3051833215b842294279e49995 |
| hovercard-subject-tag | issue:1814842738 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/8600/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a192147369197b9cadea752818039107c9e04b803af0865b80d21f8b327aa547/getsentry/sentry-javascript/issues/8600 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a192147369197b9cadea752818039107c9e04b803af0865b80d21f8b327aa547/getsentry/sentry-javascript/issues/8600 |
| og:image:alt | 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 th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | joeldotsh |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85dd75377eb77313206b8fc108bcee6a3a029286d94bf32bf9b4426e4d92e0c4 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0d64fa748a2bab9a5b587a967ac4da1cfa8da6dd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width