feat(remix): Upload source maps from the Vite plugin - #24463
Conversation
size-limit report 📦
|
|
bugbot run |
30cf8b7 to
da4b0b8
Compare
|
bugbot run |
1 similar comment
|
bugbot run |
f1db477 to
a32a5d0
Compare
|
bugbot run |
|
bugbot run |
|
bugbot run |
2ea4d63 to
948599d
Compare
|
bugbot run |
948599d to
9e2f00c
Compare
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 4 total unresolved issues (including 3 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9e2f00c. Configure here.
| // Uploading from the dev server would create a new set of artifacts on every restart. | ||
| if (process.env.NODE_ENV === 'development' || options.sourcemaps?.disable === true) { | ||
| return plugins; | ||
| } |
There was a problem hiding this comment.
If someone sets disable: true now, it drops more than source maps now. If people any other options, those are not forwarded to the plugins anymore.
Or is this intentional?
There was a problem hiding this comment.
Nice catch that is an oversight, this is handled in the plugin anyways. I'll remove the gate here
`sentryRemixVitePlugin` now injects debug IDs and uploads source maps as part of the build, so Vite-based Remix apps no longer need the `sentry-upload-sourcemaps` script. The deletion default is scoped to `./build/**/*.map` rather than `./**/*.map`, because the bundler plugin globs it without ignoring `node_modules` and deletes with `force: true`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`sourceMaps.ts` imports `@sentry/bundler-plugins/vite`, which was not declared in `package.json` - published installs could not resolve it. Vite passes the already-merged config to every `config` hook, so the files-to-delete plugin has to run before `makeEnableSourceMapsPlugin` sets `build.sourcemap`; otherwise it treats the setting as user-owned and leaves the generated source maps on disk. Also returns only the changed key from the `config` hook, since Vite concatenates arrays when merging the returned value. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`sourcemaps.disable: 'disable-upload'` injects debug IDs but leaves the upload to the user. The bundler plugin deletes `filesToDeleteAfterUpload` in a `finally` block even when it skipped uploading, so defaulting the deletion removed the very maps that still had to be uploaded by hand. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A hardcoded `./build/**/*.map` left a custom Remix `buildDirectory` untouched, silently shipping its source maps. Deriving the glob from `build.outDir` also scopes Remix's client and SSR passes to the output each one actually emitted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Vite resolves `build.outDir` to an absolute path, so prefixing it with `./` produced `.//abs/path/**/*.map`, which matches nothing and left the generated source maps in the production output. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`glob` reads a backslash as an escape, so a Windows `outDir` produced a pattern that matched nothing and left the generated source maps on disk. Both path flavours are now checked for absoluteness, since `path.isAbsolute` only recognises the host platform's form. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`sourcemaps.disable: true` skipped the whole bundler plugin, which also applies bundle size optimizations, module metadata, the application key and release management. The plugin already declines the upload on its own, so only the source map setting plugin needs gating. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
c46a741 to
7f9cd08
Compare
Asserts each client chunk carries exactly one debug ID and that the shipped IDs match the uploaded artifact bundles. Stacked on #24463. --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

sentryRemixVitePluginnow injects debug IDs and uploads source maps as part of the build. Options widen toBuildTimeOptionsBase; opt out withsourcemaps.disable.Deletion defaults to
./build/**/*.maprather than./**/*.map, which the bundler plugin globs without ignoringnode_modulesbefore deleting withforce: true.