angular: Upgrade to 9.1 - hangs on 0% compiling

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, the previous version in which this bug was not present was: 9.0.7

Description

Yesterday I was working on angular@9.07 and today there was update to 9.1 which I did. And now ng serve is hanging on 0% compiling for 5 minutes πŸ˜• Here is my screenshot: ng-hang

πŸ”¬ Minimal Reproduction

πŸ”₯ Exception or Error




```
{
  "name": "@infirma/frontend",
  "version": "3.3.0",
  "scripts": {
    "ng": "ng",
    "start:n": "ng serve",
    "start": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng serve --extra-webpack-config webpack.extra.js",
    "start:aot": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng serve --aot",
    "build": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --aot --build-optimizer --progress=true --extra-webpack-config webpack.extra.js",
    "build:prod": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --prod --build-optimizer --progress=true --extra-webpack-config webpack.extra.js",
    "build:prod:source-map": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --prod --build-optimizer --progress=true --source-map --extra-webpack-config webpack.extra.js",
    "build:prod:source-map:named-chunks": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --prod --build-optimizer --progress=true --source-map --named-chunks --extra-webpack-config webpack.extra.js",
    "build:prod:no-aot": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --prod --no-aot --build-optimizer false --extra-webpack-config webpack.extra.js",
    "build:prod:analyzer": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --prod --source-map --stats-json --build-optimizer --progress=true --extra-webpack-config webpack.extra.js",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "bundle-analize": "webpack-bundle-analyzer dist/frontend/stats.json",
    "http-server": "http-server -p 8080 -c-1 dist/frontend"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "^1.1.0",
    "@agm/js-marker-clusterer": "^1.1.0",
    "@amcharts/amcharts4": "^4.7.15",
    "@amcharts/amcharts4-geodata": "^4.1.9",
    "@angular/animations": "~9.1.0",
    "@angular/cdk": "^9.2.0",
    "@angular/common": "~9.1.0",
    "@angular/compiler": "~9.1.0",
    "@angular/core": "~9.1.0",
    "@angular/forms": "~9.1.0",
    "@angular/platform-browser": "~9.1.0",
    "@angular/platform-browser-dynamic": "~9.1.0",
    "@angular/pwa": "^0.900.7",
    "@angular/router": "~9.1.0",
    "@angular/service-worker": "~9.1.0",
    "@auth0/angular-jwt": "^4.0.0",
    "@exalif/ngx-breadcrumbs": "^7.1.1",
    "@fortawesome/angular-fontawesome": "^0.6.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.28",
    "@fortawesome/free-brands-svg-icons": "^5.13.0",
    "@fortawesome/pro-light-svg-icons": "^5.13.0",
    "@fortawesome/pro-regular-svg-icons": "^5.13.0",
    "@fortawesome/pro-solid-svg-icons": "^5.13.0",
    "@fullcalendar/bootstrap": "^4.4.0",
    "@fullcalendar/core": "^4.4.0",
    "@fullcalendar/daygrid": "^4.4.0",
    "@fullcalendar/google-calendar": "^4.4.0",
    "@fullcalendar/interaction": "^4.4.0",
    "@fullcalendar/list": "^4.4.0",
    "@fullcalendar/rrule": "^4.4.0",
    "@fullcalendar/timegrid": "^4.4.0",
    "@lukana/alerts": "^0.9.1",
    "@lukana/data-checker": "^0.9.0",
    "@lukana/dropdowns": "^0.9.0",
    "@lukana/loading-indicator": "^0.9.2",
    "@lukana/modals": "^0.9.0",
    "@lukana/ng-pick-datetime": "^0.9.1",
    "@lukana/paginator": "^0.9.0",
    "@lukana/tooltips": "^0.9.2",
    "@ng-select/ng-select": "3.7.3",
    "@ngxs/router-plugin": "3.6.2",
    "@ngxs/store": "3.6.2",
    "@schemater/bootstrap": "0.9.0",
    "@schemater/bootstrap-color": "0.9.0",
    "@schemater/components": "^0.9.1",
    "@schemater/core": "0.9.1",
    "@schemater/datetime": "0.9.0",
    "@schemater/filter-bar": "^0.9.0",
    "@schemater/sortable-arrays": "^0.9.2",
    "@sentry/browser": "^5.15.0",
    "agm-direction": "^0.7.9",
    "angular-gridster2": "^9.1.0",
    "angular2-hotkeys": "^2.2.0",
    "bootstrap": "^4.4.1",
    "ckeditor4-angular": "^1.1.0",
    "flag-icon-css": "^3.4.6",
    "js-marker-clusterer": "^1.0.0",
    "lodash": "^4.17.15",
    "moment": "^2.24.0",
    "ng-animate": "^0.3.4",
    "ngx-bootstrap": "^5.5.0",
    "ngx-build-plus": "^9.0.6",
    "ngx-color-picker": "^9.0.0",
    "ngx-sortablejs": "^3.1.4",
    "ngx-take-until-destroy": "^5.4.0",
    "npm": "^6.14.3",
    "rrule": "^2.6.4",
    "rxjs": "~6.5.4",
    "tslib": "^1.10.0",
    "sortablejs": "^1.10.2",
    "zone.js": "~0.10.3",
    "zxcvbn": "^4.4.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.901.0",
    "@angular/cli": "~9.1.0",
    "@angular/compiler-cli": "~9.1.0",
    "@angular/language-service": "~9.1.0",
    "@ngxs/devtools-plugin": "^3.6.2",
    "@types/ckeditor": "^4.9.8",
    "@types/faker": "^4.1.10",
    "@types/googlemaps": "^3.30.16",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.6",
    "@types/node": "~10.12.18",
    "codelyzer": "~5.2.1",
    "faker": "^4.1.0",
    "jasmine-core": "~3.3.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^4.4.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.2",
    "ts-node": "~8.0.1",
    "tslint": "~5.12.1",
    "typescript": "~3.7.5",
    "webpack-bundle-analyzer": "^3.6.1"
  }
}
```

🌍 Your Environment





     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / β–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 9.1.0
Node: 12.16.1
OS: win32 x64

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

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.901.0
@angular-devkit/build-angular     0.901.0
@angular-devkit/build-optimizer   0.901.0
@angular-devkit/build-webpack     0.901.0
@angular-devkit/core              8.0.0
@angular-devkit/schematics        8.0.0
@angular/cdk                      9.2.0
@angular/pwa                      0.900.7
@ngtools/webpack                  9.1.0
@schematics/angular               8.0.0
@schematics/update                0.901.0
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.42.0

Anything else relevant?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 49 (19 by maintainers)

Most upvoted comments

Two days ago, I found a problem in my project. In the tsconfig.json file there were sections" files β€œand” include "

{
  "compilerOptions": {
    "types": ["node", "jest" ]
  },
  "extends": "../../tsconfig.json",
  "files": ["src/main.ts", "src/polyfills.ts"],
  "include": [
    "src/**/*.d.ts"
  ]
}

And the same sections in the file tsconfig.app.json

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "../../dist/out-tsc",
    "types": []
  },
  "files": ["src/main.ts", "src/polyfills.ts"],
  "exclude": ["src/test.ts", "**/*.spec.ts"]
}

I deleted β€œfiles” and β€œinclude” in tsconfig.json and the project began to build as quickly as in Angular 8 πŸŽ‰. But the tests still took 5 minutes to build. However, I upgraded to 9.1.10 yesterday and the tests build quickly. Everything works well πŸŽ‰πŸŽ‰πŸŽ‰.

I am facing the same issue. It’s just stuck at 0% compiling and does not move forward for over 10 minutes. It then starting compiling of each single node_module dependency which is also taking very long. "@angular/core": "9.1.2" "@angular/cli": "^9.0.1"

Same here, it was fine with @angular/core@9.1.0-rc.0 and @angular/cli@9.1.0-next4.

Note that src/__ngcc_entry_points__.json is created in application workspace, is this intended ?

I can confirm as well that with 9.1.11 the issue is resolved, compile times are back to what it was in my case with angular 6, which is about 40 seconds to 1 minute, which is feasible in my scenario according to the project overall complexity.

@petebacondarwin I can confirm 9.1.10 fixed the ngcc performance problem. Pretty much every ngcc invocation took < 2msec. Woohoo!

And please open a new issue with this reproduction so that it can be addressed directly. The difficulty with appending it to this issue is that similar symptoms can be caused by different underlying processing. It is better to have multiple issues that we can aggregate into a single one later than a single issue that covers lots of problems.

Thanks for the extra info… we should not be writing that file to src directory. It should be going into the node_modules folder. So something is not right. This might not be the cause of your build hanging though.

Could you provide more information about your project setup? Ideally a repository that I can clone and use to debug the problem.

In @nrwl/nx case it is being written to /libs directory.