Skip to content
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

Angular 9.0.3 ngcc fails to process ng2-dragula #35709

Closed
log2-hwan opened this issue Feb 27, 2020 · 40 comments
Closed

Angular 9.0.3 ngcc fails to process ng2-dragula #35709

log2-hwan opened this issue Feb 27, 2020 · 40 comments
Labels
freq3: high regression Indicates than the issue relates to something that worked in a previous version type: bug/fix
Milestone

Comments

@log2-hwan
Copy link

log2-hwan commented Feb 27, 2020

🐞 bug report

Affected Package

@angular/compiler-cli

Is this a regression?

Yes it works properly with angular 9.0.2

Description

ngcc build failed with ng2-dragula.

🔬 Minimal Reproduction

  1. Clone https://github.com/log2-hwan/ngcc-ng2-dragula-bug-demo
  2. npm install
  3. npm run build ngcc-ng2-dragula-bug-demo
  4. Build failed with error

🔥 Exception or Error


0% compiling
Compiling @angular/core : es2015 as esm2015

Compiling @angular/common : es2015 as esm2015

Compiling @angular/platform-browser : es2015 as esm2015

Compiling @angular/platform-browser-dynamic : es2015 as esm2015

Compiling ng2-dragula : es2015 as esm2015

ERROR in Cannot read property 'push' of undefined

🌍 Your Environment

Angular Version:




     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 9.0.3
Node: 13.8.0
OS: darwin x64

Angular: 9.0.3
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.3
@angular-devkit/build-angular     0.900.3
@angular-devkit/build-optimizer   0.900.3
@angular-devkit/build-webpack     0.900.3
@angular-devkit/core              9.0.3
@angular-devkit/schematics        9.0.3
@ngtools/webpack                  9.0.3
@schematics/angular               9.0.3
@schematics/update                0.900.3
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2

Anything else relevant?
I guess the error is caused by commit df816c9 which is related to sourcemap processing, so ng2-dragula's sourcemap may have some problems.

@sbradl
Copy link

sbradl commented Feb 27, 2020

Same for me with the package @ngx-translate/http-loader

Error: Error on worker #1: TypeError: Cannot read property 'push' of undefined
at SourceFile.renderFlattenedSourceMap (...\@angular\compiler-cli\ngcc\src\sourcemaps\source_file.js:73:33)
at Object.renderSourceAndMap (...\@angular\compiler-cli\ngcc\src\rendering\source_maps.js:34:42)
at Renderer.renderFile (...\@angular\compiler-cli\ngcc\src\rendering\renderer.js:93:38)
at ...\@angular\compiler-cli\ngcc\src\rendering\renderer.js:50:84
at Array.forEach (<anonymous>)
at Renderer.renderProgram (...\@angular\compiler-cli\ngcc\src\rendering\renderer.js:45:54)
at Transformer.transform (...\@angular\compiler-cli\ngcc\src\packages\transformer.js:77:42)
at ClusterWorker.compile (...\@angular\compiler-cli\ngcc\src\main.js:168:42)
at Worker.<anonymous> (...\@angular\compiler-cli\ngcc\src\execution\cluster\worker.js:44:42)
at Worker.emit (events.js:200:13)
at ClusterMaster.onWorkerMessage (...\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:158:27)
at ...\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:46:95
at ClusterMaster.<anonymous> (...\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:238:57)
at step (...\tslib\tslib.js:139:27)
at Object.next (...\tslib\tslib.js:120:57)
at ...\tslib\tslib.js:113:75
at new Promise (<anonymous>)
at Object.__awaiter (...\tslib\tslib.js:109:16)
at EventEmitter.<anonymous> (...\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:232:32)
at EventEmitter.emit (events.js:200:13)

@Ledzz
Copy link

Ledzz commented Feb 27, 2020

I have an error ERROR in Cannot read property 'flattenedMappings' of null, seems to me this is related

@gokselb
Copy link

gokselb commented Feb 27, 2020

I am having same error while trying to build my angular library

Package.json

    "@angular/animations": "^9.0.3",
    "@angular/cdk": "^9.1.0",
    "@angular/common": "^9.0.3",
    "@angular/compiler": "^9.0.3",
    "@angular/core": "^9.0.3",
    "@angular/forms": "^9.0.3",
    "@angular/platform-browser": "^9.0.3",
    "@angular/platform-browser-dynamic": "^9.0.3",
    "@angular/router": "^9.0.3",

Error Log

[error] TypeError: Cannot read property 'flattenedMappings' of null
    at _loop_1 (/home/havelsan/git/bilisim-common-library/node_modules/@angular/compiler-cli/ngcc/src/sourcemaps/source_file.js:104:29)
    at SourceFile.flattenMappings (/home/havelsan/git/bilisim-common-library/node_modules/@angular/compiler-cli/ngcc/src/sourcemaps/source_file.js:168:17)
    at new SourceFile (/home/havelsan/git/bilisim-common-library/node_modules/@angular/compiler-cli/ngcc/src/sourcemaps/source_file.js:47:43)
    at SourceFileLoader.loadSourceFile (/home/havelsan/git/bilisim-common-library/node_modules/@angular/compiler-cli/ngcc/src/sourcemaps/source_file_loader.js:64:20)
    at /home/havelsan/git/bilisim-common-library/node_modules/@angular/compiler-cli/ngcc/src/sourcemaps/source_file_loader.js:105:30
    at Array.map (<anonymous>)
    at SourceFileLoader.processSources (/home/havelsan/git/bilisim-common-library/node_modules/@angular/compiler-cli/ngcc/src/sourcemaps/source_file_loader.js:102:32)
    at SourceFileLoader.loadSourceFile (/home/havelsan/git/bilisim-common-library/node_modules/@angular/compiler-cli/ngcc/src/sourcemaps/source_file_loader.js:60:32)
    at Object.renderSourceAndMap (/home/havelsan/git/bilisim-common-library/node_modules/@angular/compiler-cli/ngcc/src/rendering/source_maps.js:33:36)
    at Renderer.renderFile (/home/havelsan/git/bilisim-common-library/node_modules/@angular/compiler-cli/ngcc/src/rendering/renderer.js:93:38)

@euangoddard
Copy link

I am also getting this error since upgrading to Angular 9.0.3 Cannot read property 'flattenedMappings' of null. It seems to be when ngcc runs on third party libraries. In my case I am not using either of the two libraries mentioned in the preceding comments (failing point for me is during compilation of angular-safeguard to esm5)

@wartab
Copy link
Contributor

wartab commented Feb 27, 2020

I had trouble with ngcc when compiling @angular/animations.

Compiling @angular/animations : es2015 as esm2015
Error: Error on worker #2: RangeError: Maximum call stack size exceeded
    at JSON.parse (<anonymous>)
    at SourceFileLoader.loadRawSourceMap (C:\Users\Vincent\web-acc\node_modules\@angular\compiler-cli\ngcc\src\sourcemaps\source_file_loader.js:113:25)
    at SourceFileLoader.loadSourceMap (C:\Users\Vincent\web-acc\node_modules\@angular\compiler-cli\ngcc\src\sourcemaps\source_file_loader.js:91:36)
    at SourceFileLoader.loadSourceFile (C:\Users\Vincent\web-acc\node_modules\@angular\compiler-cli\ngcc\src\sourcemaps\source_file_loader.js:53:35)
    at C:\Users\Vincent\web-acc\node_modules\@angular\compiler-cli\ngcc\src\sourcemaps\source_file_loader.js:105:30
    at Array.map (<anonymous>)
    at SourceFileLoader.processSources (C:\Users\Vincent\web-acc\node_modules\@angular\compiler-cli\ngcc\src\sourcemaps\source_file_loader.js:102:32)
    at SourceFileLoader.loadSourceFile (C:\Users\Vincent\web-acc\node_modules\@angular\compiler-cli\ngcc\src\sourcemaps\source_file_loader.js:60:32)
    at C:\Users\Vincent\web-acc\node_modules\@angular\compiler-cli\ngcc\src\sourcemaps\source_file_loader.js:105:30
    at Array.map (<anonymous>)
    at ClusterMaster.onWorkerMessage (C:\Users\Vincent\web-acc\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:158:27)
    at C:\Users\Vincent\web-acc\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:46:95
    at ClusterMaster.<anonymous> (C:\Users\Vincent\web-acc\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:238:57)
    at step (C:\Users\Vincent\web-acc\node_modules\tslib\tslib.js:139:27)
    at Object.next (C:\Users\Vincent\web-acc\node_modules\tslib\tslib.js:120:57)
    at C:\Users\Vincent\web-acc\node_modules\tslib\tslib.js:113:75
    at new Promise (<anonymous>)
    at Object.__awaiter (C:\Users\Vincent\web-acc\node_modules\tslib\tslib.js:109:16)
    at EventEmitter.<anonymous> (C:\Users\Vincent\web-acc\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:232:32)
    at EventEmitter.emit (events.js:200:13)
Compiling @angular/compiler/testing : es2015 as esm2015
Compiling @angular/core : es2015 as esm2015
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! web-acc@2.1.9 postinstall: `ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the web-acc@2.1.9 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Vincent\AppData\Roaming\npm-cache\_logs\2020-02-27T08_44_05_048Z-debug.log

I don't know if you guys will have success with this, but the issue went away when deleting node_modules and package-lock.json and reinstalling everything from scratch.

@EmaGht
Copy link

EmaGht commented Feb 27, 2020

Also fails on ngx-toastr apparently:
image

Worked with previous version

@eduboxgithub
Copy link

eduboxgithub commented Feb 27, 2020

I'm using the latest version of Angular 9.0.3 with Ionic and I'm also getting an error:
Error in Maximum call stack size exceeded.

D:_GIT\AppMobile>ionic serve

ng.cmd run app:serve --host=localhost --port=8100
[ng] Compiling @ionic-native/core : module as esm5
[ng] chunk {main} main.js, main.js.map (main) 1.99 kB [initial] [rendered]
[ng] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 154 kB [initial] [rendered]
[ng] chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
[ng] chunk {styles} styles.js, styles.js.map (styles) 175 kB [initial] [rendered]
[ng] chunk {vendor} vendor.js, vendor.js.map (vendor) 340 kB [initial] [rendered]
[ng] Date: 2020-02-27T10:29:35.820Z - Hash: a3f4bd6e29f42295bb9b - Time: 5304ms
[ng]
[ng] ERROR in Maximum call stack size exceeded

[INFO] Development server running!

   Local: http://localhost:8100   
   
   Use Ctrl+C to quit this process

[INFO] Browser window opened to http://localhost:8100!

@wmarques
Copy link
Contributor

Looks related to #35132

@petebacondarwin
Copy link
Member

Yes I agree. Looking for a fix now.

@petebacondarwin
Copy link
Member

In the case of ng2-dragula I can't reproduce the error using the repo above...

> ngcc-ng2-dragula-bug-demo@0.0.0 build /Users/pete/dev/angular/tmp/ngcc-ng2-dragula-bug-demo
> ng build

0% compiling
Compiling @angular/core : es2015 as esm2015

Compiling @angular/common : es2015 as esm2015

Compiling @angular/platform-browser : es2015 as esm2015

Compiling @angular/platform-browser-dynamic : es2015 as esm2015

Compiling ng2-dragula : es2015 as esm2015
Generating ES5 bundles for differential loading...
ES5 bundle generation complete.

chunk {runtime} runtime-es2015.js, runtime-es2015.js.map (runtime) 6.16 kB [entry] [rendered]
chunk {runtime} runtime-es5.js, runtime-es5.js.map (runtime) 6.16 kB [entry] [rendered]
chunk {polyfills} polyfills-es2015.js, polyfills-es2015.js.map (polyfills) 140 kB [initial] [rendered]
chunk {main} main-es2015.js, main-es2015.js.map (main) 11 kB [initial] [rendered]
chunk {main} main-es5.js, main-es5.js.map (main) 12.1 kB [initial] [rendered]
chunk {styles} styles-es2015.js, styles-es2015.js.map (styles) 9.74 kB [initial] [rendered]
chunk {styles} styles-es5.js, styles-es5.js.map (styles) 11 kB [initial] [rendered]
chunk {polyfills-es5} polyfills-es5.js, polyfills-es5.js.map (polyfills-es5) 647 kB [initial] [rendered]
chunk {vendor} vendor-es2015.js, vendor-es2015.js.map (vendor) 2.45 MB [initial] [rendered]
chunk {vendor} vendor-es5.js, vendor-es5.js.map (vendor) 2.86 MB [initial] [rendered]
Date: 2020-02-27T11:57:20.547Z - Hash: 9c0abec346dcb04685be - Time: 27843ms

@petebacondarwin
Copy link
Member

But the flattenedMappings error is due to the original sources being missing... which makes source-map flattening difficult if not impossible... working on a fix.

@rohanahata
Copy link

rohanahata commented Feb 27, 2020

What's a good short term fix for the people who are updating from 7.1 to 9.0.x at this time?
I'm a relative noob, inheriting a project and incharge of migrating it.

@petebacondarwin
Copy link
Member

@rohanahata - fix on 9.0.2 until 9.0.4 is released.

@rohanahata
Copy link

The following is my package.json. Which ones do I change to 9.0.2 to downgrade?

{
  "name": "blah_blah",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~9.0.3",
    "@angular/cdk": "~9.1.0",
    "@angular/common": "~9.0.3",
    "@angular/compiler": "~9.0.3",
    "@angular/core": "~9.0.3",
    "@angular/forms": "~9.0.3",
    "@angular/platform-browser": "~9.0.3",
    "@angular/platform-browser-dynamic": "~9.0.3",
    "@angular/platform-server": "~9.0.3",
    "@angular/router": "~9.0.3",
    "@ng-idle/core": "~8.0.0-beta.4",
    "@ng-idle/keepalive": "~8.0.0-beta.4",
    "@ngui/map": "~0.30.3",
    "@types/googlemaps": "~3.39.3",
    "ammap3": "~3.21.15",
    "angular-archwizard": "~5.0.0",
    "angular-datatables": "~8.0.0",
    "angular2-multiselect-dropdown": "~4.6.3",
    "angularx-qrcode": "~2.1.0",
    "ap-angular-fullcalendar": "~1.7.10",
    "bootstrap": "^4.4.1",
    "chart.js": "~2.9.3",
    "core-js": "~3.6.4",
    "d3": "5.15.0",
    "datatables.net": "~1.10.20",
    "datatables.net-dt": "~1.10.20",
    "fullcalendar": "3.10.1",
    "imagesloaded": "~4.1.4",
    "jquery": "^3.4.1",
    "moment": "~2.24.0",
    "ng-selectize": "^1.1.3",
    "ng2-charts": "~2.3.0",
    "ng2-dragula": "~2.1.1",
    "ng2-nouislider": "^2.0.0-beta.0",
    "ng2-nvd3": "~2.0.0",
    "ng2-toasty": "^4.0.3",
    "ng2-validation": "~4.2.0",
    "ngx-owl-carousel-o": "~2.0.3",
    "ngx-perfect-scrollbar": "~9.0.0",
    "node-sass": "^4.13.1",
    "nouislider": "~14.1.1",
    "nvd3": "~1.8.6",
    "pace-js": "~1.0.2",
    "popper.js": "~1.16.1",
    "primeicons": "~2.0.0",
    "primeng": "~9.0.0",
    "rxjs": "~6.5.4",
    "rxjs-compat": "~6.5.4",
    "selectize": "~0.12.6",
    "sweetalert2": "~9.8.2",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.900.3",
    "@angular/cli": "~9.0.3",
    "@angular/compiler-cli": "~9.0.3",
    "@angular/language-service": "~9.0.3",
    "@types/datatables.net": "~1.10.18",
    "@types/jasmine": "~3.5.7",
    "@types/jasminewd2": "~2.0.8",
    "@types/jquery": "~3.3.33",
    "@types/node": "~13.7.6",
    "codelyzer": "^5.2.1",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.4.1",
    "karma-chrome-launcher": "~3.1.0",
    "karma-cli": "~2.0.0",
    "karma-coverage-istanbul-reporter": "~2.1.1",
    "karma-jasmine": "~3.1.1",
    "karma-jasmine-html-reporter": "~1.5.2",
    "protractor": "~5.4.3",
    "rxjs-tslint": "~0.1.7",
    "ts-node": "~8.6.2",
    "tslint": "~6.0.0",
    "typescript": "3.8.2"
  }
}

@petebacondarwin
Copy link
Member

At a minimum you need to change @angular/compiler-cli from "~9.0.3" to "9.0.2". But to be on the safe side you could change all the ~9.0.3 to 9.0.2 and also the ~0.900.3 to 0.900.2.

petebacondarwin added a commit to petebacondarwin/angular that referenced this issue Feb 27, 2020
If a package has a source-map but it does not provide
the actual content of the sources, then the source-map
flattening was crashing.

Now we ignore such mappings that have no source
since we are not able to compute the merged
mapping if there is no source file.

Fixes angular#35709
petebacondarwin added a commit to petebacondarwin/angular that referenced this issue Feb 27, 2020
If a package has a source-map but it does not provide
the actual content of the sources, then the source-map
flattening was crashing.

Now we ignore such mappings that have no source
since we are not able to compute the merged
mapping if there is no source file.

Fixes angular#35709
@petebacondarwin
Copy link
Member

So I have a fix for the Cannot read property 'flattenedMappings' of null error in #35718.
Looking at why the following error occurs:

Error: Error on worker #1: TypeError: Cannot read property 'push' of undefined
at SourceFile.renderFlattenedSourceMap (...\@angular\compiler-cli\ngcc\src\sourcemaps\source_file.js:73:33)

It seems that there is a mapping to a line that doesn't actually exist in the original source content.

@euangoddard
Copy link

In the case of ng2-dragula I can't reproduce the error using the repo above...

@petebacondarwin I found that I could get past some issues in packages by removing node_modules and re-running npm install and then ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points so it may be there is some order that matters or slight variations in packages interact badly with each other.

@mansurmuaz
Copy link

mansurmuaz commented Feb 27, 2020

I had same error and tried many different solution. Finally I've solved it with adding following lines to tsconfig.app.json.

"angularCompilerOptions": {
    "enableIvy": false
  }

Basically, it will be solved when you disable the "Ivy" on angularCompilerOptions.

@wartab
Copy link
Contributor

wartab commented Feb 27, 2020

The proper solution was given above. Liking your own advice doesn't increase its weight. Disabling Ivy is not the way to go. Just downgrade the Angular Version to yesterday's.

@GitHubish
Copy link

For me, even using version 9.0.2 I still get the error :
ERROR in Cannot read property 'push' of undefined

Am I missing something? What can I provide that might be useful?

@Ploppy3
Copy link

Ploppy3 commented Feb 27, 2020

@GitHubish Remove the node_modules folder & your package manager's lock file and finally run the install command again

@magnolemos
Copy link

magnolemos commented Feb 27, 2020

Here it works after deleting node_modules and running npm i again.

I'm using angular 9.0.3

@GitHubish
Copy link

GitHubish commented Feb 27, 2020

@Ploppy3 same thing

$ ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points
Warning: Failed to read entry point info from [project]/node_modules/npmconf/test/fixtures/package.json with error SyntaxError: Unexpected end of JSON input.
Compiling @angular/cdk/accordion : es2015 as esm2015
Compiling @egjs/ngx-children-differ : es2015 as esm2015
Error: Error on worker #4: TypeError: Cannot read property 'push' of undefined
    at SourceFile.renderFlattenedSourceMap ([project]\node_modules\@angular\compiler-cli\ngcc\src\sourcemaps\source_file.js:73:33)
    at Object.renderSourceAndMap ([project]\node_modules\@angular\compiler-cli\ngcc\src\rendering\source_maps.js:34:42)
    at DtsRenderer.renderDtsFile ([project]\node_modules\@angular\compiler-cli\ngcc\src\rendering\dts_renderer.js:105:34)
    at [project]\node_modules\@angular\compiler-cli\ngcc\src\rendering\dts_renderer.js:68:134
    at Map.forEach (<anonymous>)
    at DtsRenderer.renderProgram ([project]\node_modules\@angular\compiler-cli\ngcc\src\rendering\dts_renderer.js:68:26)
    at Transformer.transform ([project]\node_modules\@angular\compiler-cli\ngcc\src\packages\transformer.js:81:52)
    at ClusterWorker.compile ([project]\node_modules\@angular\compiler-cli\ngcc\src\main.js:168:42)
    at Worker.<anonymous> ([project]\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\worker.js:44:42)
    at Worker.emit (events.js:311:20)
    at ClusterMaster.onWorkerMessage ([project]\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:158:27)
    at [project]\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:46:95
    at ClusterMaster.<anonymous> ([project]\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:238:57)
    at step ([project]\node_modules\tslib\tslib.js:139:27)
    at Object.next ([project]\node_modules\tslib\tslib.js:120:57)
    at [project]\node_modules\tslib\tslib.js:113:75
    at new Promise (<anonymous>)
    at Object.__awaiter ([project]\node_modules\tslib\tslib.js:109:16)
    at EventEmitter.<anonymous> ([project]\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:232:32)
    at EventEmitter.emit (events.js:311:20)
Compiling @angular/common : es2015 as esm2015
Compiling @angular/animations/browser : es2015 as esm2015
Compiling @ngx-translate/core : es2015 as esm2015
Compiling @angular/cdk/observers : es2015 as esm2015
Compiling ngx-infinite-scroll : es2015 as esm2015
Compiling @angular/core/testing : es2015 as esm2015
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

@petebacondarwin
Copy link
Member

@GitHubish - did you change the package.json dependencies to 9.0.2 before removing node_modules and running npm i?

@Frosch
Copy link

Frosch commented Feb 27, 2020

Also fails on ngx-loading-bar@4.2.0, using @angular/compiler-cli@9.0.3. All fine using 9.0.2.

@pkozlowski-opensource pkozlowski-opensource added comp: ngcc regression Indicates than the issue relates to something that worked in a previous version labels Feb 27, 2020
@ngbot ngbot bot modified the milestone: needsTriage Feb 27, 2020
@tomgruszowski
Copy link

tomgruszowski commented Feb 27, 2020

The normal cycle is to release a new patch version every week. Given that 9.0.3 came out yesterday, I expect 9.0.4 to be released next Wednesday 4th March.

This seems like a pretty bad regression to wait this long, unless 'revert to old version' is acceptable.

*edit - thanks for the quick turnaround ng team :)

@ngbot ngbot bot modified the milestones: needsTriage, Backlog Feb 27, 2020
petebacondarwin added a commit to petebacondarwin/angular that referenced this issue Feb 27, 2020
If a package has a source-map but it does not provide
the actual content of the sources, then the source-map
flattening was crashing.

Now we ignore such mappings that have no source
since we are not able to compute the merged
mapping if there is no source file.

Fixes angular#35709
petebacondarwin added a commit to petebacondarwin/angular that referenced this issue Feb 27, 2020
…-maps

Previously when rendering flattened source-maps, it was assumed that no
mapping would come from a line that is outside the lines of the actual
source content. It turns out this is not a valid assumption.

Now the code that renders flattened source-maps will handle such
mappings, with the additional benefit that the rendered source-map
will only contain mapping lines up to the last mapping, rather than a
mapping line for every content line.

Fixes angular#35709
@petebacondarwin
Copy link
Member

@tomgruszowski - we hear you.

The PR is just about green and should be merged in the next hour. The plan is to then roll out a new patch release. So you should be unblocked before the end of the day.

Sorry that this release caused some issues and frustration.

matsko pushed a commit that referenced this issue Feb 27, 2020
If a package has a source-map but it does not provide
the actual content of the sources, then the source-map
flattening was crashing.

Now we ignore such mappings that have no source
since we are not able to compute the merged
mapping if there is no source file.

Fixes #35709

PR Close #35718
matsko pushed a commit that referenced this issue Feb 27, 2020
…-maps (#35718)

Previously when rendering flattened source-maps, it was assumed that no
mapping would come from a line that is outside the lines of the actual
source content. It turns out this is not a valid assumption.

Now the code that renders flattened source-maps will handle such
mappings, with the additional benefit that the rendered source-map
will only contain mapping lines up to the last mapping, rather than a
mapping line for every content line.

Fixes #35709

PR Close #35718
@matsko matsko closed this as completed in 72c4fda Feb 27, 2020
matsko pushed a commit that referenced this issue Feb 27, 2020
…-maps (#35718)

Previously when rendering flattened source-maps, it was assumed that no
mapping would come from a line that is outside the lines of the actual
source content. It turns out this is not a valid assumption.

Now the code that renders flattened source-maps will handle such
mappings, with the additional benefit that the rendered source-map
will only contain mapping lines up to the last mapping, rather than a
mapping line for every content line.

Fixes #35709

PR Close #35718
@petebacondarwin
Copy link
Member

Angular 9.0.4 has been released which should fix these problems.

@AcidSlide
Copy link

Angular 9.0.4 has been released which should fix these problems.

Nope it didn't... worse happened for me after updating to 9.0.4 from 9.0.2..

had to rollback my package* files and had to delete node_modules and run npm install to reinstall
Just rolling back package* files and running npm install didn't work that is why I had to delete node_modules

@Ploppy3
Copy link

Ploppy3 commented Feb 28, 2020

@petebacondarwin Just so you know, your commits does fix my issue.

@naveedahmed1
Copy link
Contributor

I'm receiving the same error with 9.1.0-next.2

Here's my package.json

  "dependencies": {
    "@angular/animations": "9.1.0-next.2",
    "@angular/cdk": "9.1.0",
    "@angular/common": "9.1.0-next.2",
    "@angular/compiler": "9.1.0-next.2",
    "@angular/core": "9.1.0-next.2",
    "@angular/fire": "6.0.0-rc.1",
    "@angular/forms": "9.1.0-next.2",
    "@angular/google-maps": "9.1.0",
    "@angular/material": "9.1.0",
    "@angular/platform-browser": "9.1.0-next.2",
    "@angular/platform-browser-dynamic": "9.1.0-next.2",
    "@angular/platform-server": "9.1.0-next.2",
    "@angular/pwa": "0.901.0-next.1",
    "@angular/router": "9.1.0-next.2",
    "@angular/service-worker": "9.1.0-next.2",
    "@nguniversal/module-map-ngfactory-loader": "9.0.0-next.9",
    "@ngx-lite/json-ld": "0.6.2",
    "@ngx-pwa/local-storage": "9.0.2",
    "@swimlane/ngx-charts": "13.0.2",
    "@trademe/ng-defer-load": "8.0.0-beta.2",
    "aspnet-prerendering": "3.0.1",
    "core-js": "3.2.1",
    "d3-shape": "1.3.5",
    "dayjs": "^1.8.15",
    "file-saver": "2.0.2",
    "firebase": "7.8.2",
    "hammerjs": "2.0.8",
    "moment": "2.24.0",
    "ng2-adsense": "7.0.0",
    "ng2-ckeditor": "1.2.7",
    "ngx-build-plus": "9.0.6",
    "ngx-img-cropper": "9.0.1",
    "ngx-infinite-scroll": "8.0.1",
    "rxjs": "6.5.3",
    "screenfull": "5.0.0",
    "smoothscroll-polyfill": "0.4.4",
    "web-animations-js": "^2.3.2",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-builders/custom-webpack": "9.1.0-beta.0",
    "@angular-devkit/build-angular": "0.901.0-next.1",
    "@angular/cli": "9.1.0-next.1",
    "@angular/compiler-cli": "9.1.0-next.2",
    "@angular/language-service": "9.1.0-next.2",
    "@types/jasmine": "3.4.4",
    "@types/jasminewd2": "2.0.8",
    "@types/node": "~12.7.2",
    "@types/webappsec-credential-management": "^0.5.1",
    "codelyzer": "^5.0.1",
    "concat": "3.0.0",
    "guess-parser": "0.4.12",
    "guess-webpack": "0.4.12",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^4.1.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "^2.1.0",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "^6.0.0",
    "ts-node": "~8.4.1",
    "tslint": "~5.20.0",
    "typescript": "3.6.4",
    "webpack-bundle-analyzer": "^3.3.2"
  }

Error:

chunk {main} main.js, main.js.map (main) 2.1 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 690 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 856 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 340 kB [initial] [rendered]
Date: 2020-03-02T19:45:49.314Z - Hash: 93d8deaea55c9cbcab53 - Time: 169599ms

ERROR in Cannot read property 'flattenedMappings' of null
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
0% compiling
Compiling @trademe/ng-defer-load : main as commonjs

Date: 2020-03-02T19:45:54.107Z - Hash: 93d8deaea55c9cbcab53
5 unchanged chunks

Time: 4467ms

ERROR in Cannot read property 'flattenedMappings' of null

    ERROR in node_modules/@trademe/ng-defer-load/dist/defer-load.module.d.ts:1:22 - error NG6002: Appears in the NgModule.imports of ThumbnailModule, but could not be resolved to an NgModule class.

    This likely means that the library (@trademe/ng-defer-load) which declares DeferLoadModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

@JoostK
Copy link
Member

JoostK commented Mar 2, 2020

@naveedahmed1 There has not been a hot-patch for the 9.1.0-next release line, it was only 9.0.4 that was released the same week as 9.0.3. There will be a 9.1.0-next release around Wednesday/Thursday this week that should address the crash.

@naveedahmed1
Copy link
Contributor

Thank you so much @JoostK for the update.

@Andtorrcan
Copy link

I'm receiving the same error with 9.1.0-next.2

Here's my package.json

  "dependencies": {
    "@angular/animations": "9.1.0-next.2",
    "@angular/cdk": "9.1.0",
    "@angular/common": "9.1.0-next.2",
    "@angular/compiler": "9.1.0-next.2",
    "@angular/core": "9.1.0-next.2",
    "@angular/fire": "6.0.0-rc.1",
    "@angular/forms": "9.1.0-next.2",
    "@angular/google-maps": "9.1.0",
    "@angular/material": "9.1.0",
    "@angular/platform-browser": "9.1.0-next.2",
    "@angular/platform-browser-dynamic": "9.1.0-next.2",
    "@angular/platform-server": "9.1.0-next.2",
    "@angular/pwa": "0.901.0-next.1",
    "@angular/router": "9.1.0-next.2",
    "@angular/service-worker": "9.1.0-next.2",
    "@nguniversal/module-map-ngfactory-loader": "9.0.0-next.9",
    "@ngx-lite/json-ld": "0.6.2",
    "@ngx-pwa/local-storage": "9.0.2",
    "@swimlane/ngx-charts": "13.0.2",
    "@trademe/ng-defer-load": "8.0.0-beta.2",
    "aspnet-prerendering": "3.0.1",
    "core-js": "3.2.1",
    "d3-shape": "1.3.5",
    "dayjs": "^1.8.15",
    "file-saver": "2.0.2",
    "firebase": "7.8.2",
    "hammerjs": "2.0.8",
    "moment": "2.24.0",
    "ng2-adsense": "7.0.0",
    "ng2-ckeditor": "1.2.7",
    "ngx-build-plus": "9.0.6",
    "ngx-img-cropper": "9.0.1",
    "ngx-infinite-scroll": "8.0.1",
    "rxjs": "6.5.3",
    "screenfull": "5.0.0",
    "smoothscroll-polyfill": "0.4.4",
    "web-animations-js": "^2.3.2",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-builders/custom-webpack": "9.1.0-beta.0",
    "@angular-devkit/build-angular": "0.901.0-next.1",
    "@angular/cli": "9.1.0-next.1",
    "@angular/compiler-cli": "9.1.0-next.2",
    "@angular/language-service": "9.1.0-next.2",
    "@types/jasmine": "3.4.4",
    "@types/jasminewd2": "2.0.8",
    "@types/node": "~12.7.2",
    "@types/webappsec-credential-management": "^0.5.1",
    "codelyzer": "^5.0.1",
    "concat": "3.0.0",
    "guess-parser": "0.4.12",
    "guess-webpack": "0.4.12",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^4.1.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "^2.1.0",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "^6.0.0",
    "ts-node": "~8.4.1",
    "tslint": "~5.20.0",
    "typescript": "3.6.4",
    "webpack-bundle-analyzer": "^3.3.2"
  }

Error:

chunk {main} main.js, main.js.map (main) 2.1 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 690 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 856 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 340 kB [initial] [rendered]
Date: 2020-03-02T19:45:49.314Z - Hash: 93d8deaea55c9cbcab53 - Time: 169599ms

ERROR in Cannot read property 'flattenedMappings' of null
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
0% compiling
Compiling @trademe/ng-defer-load : main as commonjs

Date: 2020-03-02T19:45:54.107Z - Hash: 93d8deaea55c9cbcab53
5 unchanged chunks

Time: 4467ms

ERROR in Cannot read property 'flattenedMappings' of null

    ERROR in node_modules/@trademe/ng-defer-load/dist/defer-load.module.d.ts:1:22 - error NG6002: Appears in the NgModule.imports of ThumbnailModule, but could not be resolved to an NgModule class.

    This likely means that the library (@trademe/ng-defer-load) which declares DeferLoadModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

I fixed downgrade to 9.0.4 release. The 9.1.0 versión hava a lot of bugs yet.

@ottodranik
Copy link

ottodranik commented Mar 12, 2020

Maybe this comment angular/angular-cli#17115 (comment) relates to current issue too.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
freq3: high regression Indicates than the issue relates to something that worked in a previous version type: bug/fix
Projects
None yet