-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed as duplicate of#4080
Labels
Description
Issue: Missing Sources in Source Map Since v0.24.1
Expected Source Map Output
{
"version": 3,
"sources": ["entry.js", "app.component.html", "app.component.ts"],
"sourcesContent": [
"import { bootstrapApplication } from '@angular/platform-browser';\nimport { AppComponent } from './app.js';\n\nbootstrapApplication(AppComponent)\n .catch((err) => console.error(err));",
"<div>",
"import { Component } from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\n\n@Component({\n selector: 'app-root',\n imports: [RouterOutlet],\n templateUrl: './app.component.html',\n})\nexport class AppComponent {\n title = 'ng19-sourcemap-repro';\n\n onClick() {\n debugger;\n }\n}\n"
],
"mappings": ";AAAA,SAAS,4BAA4B;;;;;;ACArC;;;ACAA,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAOtB,IAAM,eAAN,MAAMA,cAAY;EACvB,QAAQ;EAER,UAAO;AACL;EACF;;AALW,eAAY,WAAA;EALxB,UAAU;IACT,UAAU;IACV,SAAS,CAAC,YAAY;IACtB,UAAA;GACD;GACY,YAAY;;;AFLzB,qBAAqB,YAAY,EAC9B,MAAM,CAAC,QAAQ,QAAQ,MAAM,GAAG,CAAC;",
"names": ["AppComponent"]
}
Actual Source Map Output
{
"version": 3,
"sources": ["entry.js", "app.component.html"],
"sourcesContent": [
"import { bootstrapApplication } from '@angular/platform-browser';\nimport { AppComponent } from './app.js';\n\nbootstrapApplication(AppComponent)\n .catch((err) => console.error(err));",
"<div>"
],
"mappings": ";AAAA,SAAS,4BAA4B;A;;;;;ACArC;;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAOtB,IAAM,eAAN,MAAMA,cAAY;EACvB,QAAQ;EAER,UAAO;AACL;EACF;;AALW,eAAY,WAAA;EALxB,UAAU;IACT,UAAU;IACV,SAAS,CAAC,YAAY;IACtB,UAAA;GACD;GACY,YAAY;;;ADLzB,qBAAqB,YAAY,EAC9B,MAAM,CAAC,QAAQ,QAAQ,MAAM,GAAG,CAAC;",
"names": ["AppComponent"]
}
Summary of Issue
- Since version 0.24.1, the source map is missing
app.component.ts
. - This results in incomplete
sources
andsourcesContent
, which impacts debugging. - The expected output includes
app.component.ts
, but the actual output omits it. - Strangely, if the first import in entry.js
import { bootstrapApplication } from '@angular/platform-browser';
is omitted, the sources are generated as expected.
Reproduction
roma2341 and emopti-jruferalecarn