ng serve with esbuild/Vite ignores sourceMap configuration, injecting large inline source maps into all files
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript, vite
- Ambito
- build-system, devtools
Direzione di ricerca
Riproduci il problema con ng new, angular.json, tsconfig.json e ng serve, quindi ispeziona il JavaScript servito negli strumenti di rete del browser. Traccia il modo in cui il percorso del server di sviluppo Vite/esbuild gestisce l’impostazione sourceMap. Il lavoro è completato quando sourceMap false impedisce le mappe Base64 inline nei file JavaScript dell’applicazione e di node_modules.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Command
serve
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
The development server (ng serve), which uses Vite/esbuild, consistently injects large, inline Base64 source maps into every JavaScript file it serves.
This behavior occurs even when source maps are explicitly disabled in angular.json and/or tsconfig.json. The most problematic aspect is that this transformation is also applied to pre-built, third-party packages from node_modules.
This unnecessarily inflates file sizes (often by 2-3x), which slows down page loads in development and makes debugging in browser DevTools more difficult due to the massive file content. The core issue is that the configuration to disable this behavior is not being respected.
Minimal Reproduction
-
Create a new Angular project:
ng new sourcemap-repro cd sourcemap-repro -
In
angular.json, modify the configuration for the development server to explicitly disable all source maps. Underprojects.sourcemap-repro.architect.build.configurations.development, set thesourceMapoption:"sourceMap": false(Alternatively, using a more granular object like
{"scripts": false, "styles": false, "vendor": false}also fails to prevent the issue.) -
Run the development server:
ng serve -
Open the application in a browser and launch the developer tools (e.g., Chrome DevTools).
-
Navigate to the "Network" tab, refresh the page, and inspect any
.jsfile (e.g.,main.js,polyfills.js, or a chunk from@angular/core). -
View the "Response" or "Source" for that file.
Expected Behavior:
The served JavaScript files should not contain an inline source map. The file should end without a //# sourceMappingURL=... comment.
Actual Behavior:
Every JavaScript file has a large inline Base64 source map appended to it, directly contradicting the configuration in angular.json.
Exception or Error
Your Environment
Angular CLI: 19.2.14
Node: 20.19.0
Package Manager: npm 10.8.2
OS: darwin arm64
Angular: undefined
...
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1902.15
@angular-devkit/build-angular 19.2.14
@angular-devkit/core 19.2.14
@angular-devkit/schematics 19.2.14
@angular/cli 19.2.14
@angular/compiler 19.2.14
@angular/compiler-cli 19.2.14
@angular/language-service 19.2.14
@schematics/angular 18.2.11
ng-packagr 18.2.1
typescript 5.7.2
zone.js 0.15.0
Anything else relevant?
- Lingua principale
- TypeScript
- Stelle
- 27k
- Fork
- 11.8k
- Merge medio
- 16h 35m
- PR unite (30g)
- 176
Guida per i contributori
Apri 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 angular/angular-cli
-
area: @angular/build gemini-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
angular/angular-cli#33055 · 1 commento · 3 reazioni ·
-
unit-test: with --coverage, a setup file's hooks reach only the first spec file of each worker Apertaarea: @angular/build gemini-triaged
Difficoltà 4/5 3-5 giorni Idoneità per principianti 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 assegnatario ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 assegnatario ·
Tutte le issue di angular/angular-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
ontola/atomic-server#1625 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
melgarafael/DeskcommCRM#1451 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
-
bug via-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
midnightntwrk/midnight-sdk#403 ·