Repository navigation
ref(bundler-plugins): Pass the SDK's source map deletion through one internal option - #26903
Merged
Merged
Conversation
…internal option SDKs passed their own deletion decision through the public `deleteSourcemapsAfterUpload` and a second internal `sdkEnabledSourceMaps` option. The plugin could not tell a user's value from an SDK's, and it logged messages that named `deleteSourcemapsAfterUpload` for values the user never set. The internal `sdkDeleteSourceMaps` option replaces both. The user's `delete` and `deleteSourcemapsAfterUpload` win over it.
Contributor
size-limit report 📦Compared: 0b40f34 (PR test merge using develop at 9bba64d) Against: 9bba64d (develop) · base run #68117 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 7 not successful, 58 successful. See the run.
Successful checks
|
timfish
marked this pull request as ready for review
November 25, 2026 19:57
javascript-sdk-gitflow
Bot
requested review from
chargome,
nicohrubec and
s1gr1d
November 25, 2026 19:58
…TanStack Start comments
s1gr1d
approved these changes
Nov 26, 2026
| : { | ||
| level: 'info', | ||
| message: | ||
| 'Source maps are not uploaded. They are removed from the build output, because the Sentry SDK turned them on.', |
Member
There was a problem hiding this comment.
L: The reason could be a different one, no? Also when users specifically want to have them deleted (or they turned them on themselves).
Suggested change
| 'Source maps are not uploaded. They are removed from the build output, because the Sentry SDK turned them on.', | |
| 'Source maps are not uploaded, but the Sentry SDK removes them from the build output.', |
I let my agent check when this is printed and if the reason would be correct:
| SDK | Who turned the maps on | Log text |
|---|---|---|
| Next.js, default | SDK: sets productionBrowserSourceMaps = true and deleteSourcemapsAfterUpload: true (getFinalConfigObjectBundlerUtils.ts:266,281) |
correct |
| Gatsby, default | SDK: sets devtool: 'hidden-source-map' (gatsby-node.js:59) |
correct |
| Nuxt, default | SDK: fallback[side] (sourceMapDeletion.ts:142) |
correct |
| Next.js | user: productionBrowserSourceMaps: true + deleteSourcemapsAfterUpload: true + upload: false |
wrong reason |
| Gatsby | user: own devtool: 'source-map' + deleteSourcemapsAfterUpload: true |
wrong reason |
| Nuxt | user: sourcemap.client: true + delete: true (sourceMapDeletion.ts:138 returns the user's delete) |
wrong reason |
Collaborator
Author
There was a problem hiding this comment.
Good catch, the SDKs also pass a user's deletion choice through this option. I took your wording in 7751ddd.
…ource map deletion The SDK can also pass a user's deletion choice, so "because the Sentry SDK turned them on" was not always true.
51 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SDKs passed their source map deletion decision through the public
deleteSourcemapsAfterUpload, so the plugin could not tell SDK values from user values. This blocks deprecating that option.sdkDeleteSourceMapsoption replaces the function form ofdeleteSourcemapsAfterUploadandsdkEnabledSourceMaps:trueremoves all maps,falsekeeps them,undefineduses the plugin's rule.deleteanddeleteSourcemapsAfterUploadwin over it, sodeleteSourcemapsAfterUploadonly holds user values.deleteSourcemapsAfterUpload.deleteSourcemapsAfterUpload: true: with afilesToDeleteAfterUploadglob or a Cloudflare_worker.jsbuild, only maps of uploaded chunks are removed, not all maps. Withdisable: 'disable-upload'in SolidStart 2, the maps are kept with a warning.