-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some sourcemaps from library are not being copied to __ivy_ngcc__ #40358
Comments
OK, so I have worked out what is happening here. When we use Some files are processed by ngcc - and these one have both their source ( I think the fix is to ensure that when we do the file copy, we also check to see if there is an accompanying source-map and copy that too. The naive (and possibly acceptable way) is to just look for a similar named file end in |
This is further complicated by the fact that these copied source-maps refer to original TS files. And since the new folder is at a different level in the file system the relative paths to them are broken, even if we do copy them over. So the comprehensive solution now involves parsing the source-maps and recomputing any source URLs found within. A simpler (but probably unacceptable) way to avoid these errors is to strip the source-map comments altogether. |
When using the `NewEntryPointWriter` we copy unmodified files over to the new entry-point in addition to writing out the source files that are processed by ngcc. But we were not copying over associated source-map files for these unmodified source files, leading to warnings in downstream tooling. Now we will also copy over source-maps that reside as siblings of unmodified source files. We have to make sure that the sources of the source-map point to the correct files, so we also update the `sourceRoot` property of the copied source-map. Fixes angular#40358
…40429) When using the `NewEntryPointWriter` we copy unmodified files over to the new entry-point in addition to writing out the source files that are processed by ngcc. But we were not copying over associated source-map files for these unmodified source files, leading to warnings in downstream tooling. Now we will also copy over source-maps that reside as siblings of unmodified source files. We have to make sure that the sources of the source-map point to the correct files, so we also update the `sourceRoot` property of the copied source-map. Fixes #40358 PR Close #40429
…40429) When using the `NewEntryPointWriter` we copy unmodified files over to the new entry-point in addition to writing out the source files that are processed by ngcc. But we were not copying over associated source-map files for these unmodified source files, leading to warnings in downstream tooling. Now we will also copy over source-maps that reside as siblings of unmodified source files. We have to make sure that the sources of the source-map point to the correct files, so we also update the `sourceRoot` property of the copied source-map. Fixes #40358 PR Close #40429
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 bug report
Affected Package
Don't know the package.
Probably ivy / ngcc
Is this a regression?
Haven't tested in other versions.
Description
Some sourcemaps files from package ngx-leaflet are not being copied into the folder
__ivy_ngcc__
. It does not happen with all sourcemaps - some are there some are not. The files exist on the packagedist
.It happens when vendor sourcemaps are enabled in
angular.json
and we runng serve
.This causes several warnings because the
.map
files are referenced in the.js
files but are not found and it's not possible to debug these files if necessary.I haven't detected this problem with other packages but there's an issue in ngx-leaflet about this problem and it doesn't seem to be related to the package itself. Also it does not happen when I disable Ivy.
🔬 Minimal Reproduction
Create a new project, enable sourcemaps, install
@asymmetrik/ngx-leaflet
andleaflet
.Created a repo containing a reproduction:
1 - Clone this repo
2 -
npm install
3 -
ng serve
🔥 Exception or Error
🌍 Your Environment
Angular Version:
There's a report saying it happens with Angular 11 too.
The text was updated successfully, but these errors were encountered: