Source maps wizard leaves source maps public in Vite and webpack projects

Aperta
#1,395 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript, vite, webpack

Direzione di ricerca

Start in src/sourcemaps/tools/vite.ts at enableSourcemapGeneration and src/sourcemaps/tools/webpack.ts at enableSourcemapsGeneration, then look for the codemod tests that cover those files and run them to see how option values are asserted. Compare against @sentry/bundler-plugins behaviour for unset build.sourcemap so the wizard stops writing true/source-map over unset, false or conditional values while keeping 'hidden' and hidden-* intact. Done means unset configs stay unset, the hidden-map-plus-upload-deletion path is proposed for explicitly disabled configs, and the codemod tests cover each case.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Environment

@sentry/wizard master (b262ed0, 9.1.0 plus one commit), source maps integration, @sentry/bundler-plugins 11.17.0, Vite 7. Reproduced by running the wizard's codemods directly and building against a local fake Sentry server, not a full wizard run.

Steps to Reproduce
  1. Have a Vite project without build.sourcemap.
  2. Run npx @sentry/wizard -i sourcemaps and choose Vite.
  3. Build with an auth token so the source maps are uploaded.
  4. Look at dist/assets.
Expected Result

Source maps are uploaded and not shipped. The plugin does this by default when build.sourcemap is unset: it enables hidden maps and deletes them after the upload.

Actual Result

The wizard sets build.sourcemap: true, which opts out of that default. After the upload, the .js.map file is still in the output and the bundle references it with a sourceMappingURL comment.

  • Vite: an explicit false or a conditional value is also replaced with true. 'hidden' is kept.
  • Webpack: the codemod adds devtool: "source-map". From reading the code, values starting with hidden- stay hidden and all others become source-map. A webpack build was not run.
  • Neither flow writes an option to delete the maps.

See src/sourcemaps/tools/vite.ts (enableSourcemapGeneration) and src/sourcemaps/tools/webpack.ts (enableSourcemapsGeneration).

Suggested fix: leave unset configs alone. If source maps are explicitly disabled, ask before enabling hidden maps together with deletion after upload. This is the direction described in #1049.

Lingua principale
TypeScript
Stelle
297
Fork
88
Merge medio
5h 29m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di getsentry/sentry-wizard

Tutte le issue di getsentry/sentry-wizard

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.