remove absolute file paths embedded in sourcemaps generated by `SourceMapPlugin`
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 50/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript, webpack
- Ambito
- build-system
Direzione di ricerca
Start in packages/repack/src/plugins/SourceMapPlugin.ts, where module names are built into the source map's sources (around lines 92-95) and where the commented-out read of output.devtoolModuleFilenameTemplate sits (around lines 107-108). Check how compiler.options.context is available there and whether the webpack config can be exercised with a small production build. Done means the emitted map no longer contains machine-specific absolute paths, either by honoring the template or by defaulting to paths relative to the context. Agreeing on which of the two options to take first is likely needed with a maintainer.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
When building without a dev server (e.g. a release bundle built in CI), SourceMapPlugin names every module in the source map's sources by its absolute path on the build machine, and there's no way to override this.
RepackPlugin always applies SourceMapPlugin, and SourceMapPlugin ignores output.devtoolModuleFilenameTemplate (the line that would read it is commented out)
Why this is a problem
The source map ends up depending on where the build ran, not just on its inputs:
- Non-reproducible builds. On remote-execution or sandboxed build systems (Bazel, Buck, etc.) the absolute path includes a per-job working directory, so the same commit yields a different map on each worker:
/mnt/ci/worker/7/exec/bazel-out/<config>/bin/<target>.runfiles/<workspace>/node_modules/react-native/Libraries/Components/Pressable/Pressable.js - Error-reporting tools show machine-specific paths. Sentry and similar tools display these paths as frame filenames. Because the prefix changes between builds, a single code mapping (stack trace → repository) can't cover them.
The web-oriented default, webpack://[namespace]/[resourcePath], has none of these problems because [resourcePath] is relative to context.
Suggested solution
- Honor
output.devtoolModuleFilenameTemplatewhen set, falling back to the current behavior otherwise. This seems to be what the commented-out code intended or - Default to paths relative to
compiler.options.contextfor production builds. That keeps the map reproducible, and tools can still resolve files by joining with the project root.
Additional context
No response
- Lingua principale
- TypeScript
- Stelle
- 1.9k
- Fork
- 177
- Merge medio
- 2g 10h
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di callstack/repack
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
callstack/repack#1515 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
ScriptManager caches the rejected promise when a resolver throws, so loadScript/prefetchScript never retryForse già presa @linhh-phv l’ha presa 14 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
I maintainer di solito rispondono entro 2 giorni
-
Inlined assets with fractional scales resolve to the wrong variantForse già presa @RaphaelFakhri l’ha presa 15 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
I maintainer di solito rispondono entro 2 giorni
-
json as string in JS bundleForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
callstack/repack#1461 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
area:repack type:feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
callstack/repack#1423 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di callstack/repack
Issue simili
-
test: claim-conflict drop leaves both facts active and is never re-proposed (untested review cell)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Usage page should show API-equivalent cost and say when a connected plan shows info onlyApertaenhancement from-x
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
nightly-labs/openbot#4867 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
egonSchiele/agency-lang#1377 ·
I maintainer di solito rispondono entro 1 giorno
-
normalizePath removes the Windows device namespace prefixForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
caprover/caprover-frontend#273 ·
I maintainer di solito rispondono entro 1 giorno