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

オープン
#1,395 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript, vite, webpack

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
297
フォーク
88
平均マージ
5時間 29分
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/sentry-wizard のほかの issue

getsentry/sentry-wizard の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。