Skip to content

Partially-compiled multi-entry Ivy library missing in vendor sourcemaps #21271

Closed
@Wintermoose

Description

@Wintermoose

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

I don't know, we've moved directly from Angular 10 (with libraries published in ViewEngine build) to Angular 12

Description

We have a rather big library with multiple entry points (package.json/ng-packagr definition per module, built and published as one library). We have application with vendor sourcemaps enabled. In the vendor sourcemaps, none of our modules with any components are included. Modules containing only services or directives are included. This is true for both our usual applications, and simple minimal app generated .

Other situations:

  • library compiled in full mode: source maps included
  • vendor maps disabled: source map pointing to js files included (as expected)
  • 3rd party libraries published in ViewEngine version: source maps included
  • published vs npm linked library: identical behaviour
  • aot true/false: identical behaviour

So it seems the source maps are somehow lost the moment angular does the local (in-app) compilation of the library components' templates.

When tested with minimal library generated by ng cli, this actually works correctly, so it is caused by something in our setup (or dependencies), but at this point I am unable to figure out what (I've matched tsconfig/angular.json settings as well as I could).

I did inspect the source maps generated in the library and as far as I can tell, they're correct (paths pointing to the correct folders etc)

🔬 Minimal Reproduction

As the library is big and not public, it's not easy for me to provide reproduction. I will try to see if I can duplicate the issue by expanding the sample library; but at this point I would appreciate pointers that would help us to identify the problem. I am willing to debug the compilation pipeline, if there is an obvious starting point.

🌍 Your Environment


Angular CLI: 12.1.0
Node: 12.18.2
Package Manager: npm 6.14.11
OS: win32 x64

Angular: 12.1.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1201.0
@angular-devkit/build-angular   12.1.0
@angular-devkit/core            12.1.0
@angular-devkit/schematics      12.1.0
@angular/cli                    12.1.0
@schematics/angular             12.1.0
ng-packagr                      12.1.0
rxjs                            6.6.7
typescript                      4.3.5

Anything else relevant?

No

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions