Max call stack size for assembly using Angular CLI

I have a large project that has been working on webpack so far and everything worked well with angular @ 4.3.3. Today I was planning on porting the same to ng-cli in order to use features like generic. Everything works well and well, except when I try to build a project in prod / prod + aot which I get: Maximum call stack size exceeded.

Checked a different place for the problem, and most people say to check for circular dependency. But according to the latest cli@1.2.7 the circular dependency should have shown the build time, which is not the case. I was planning to increase the VM node stack size but couldn't figure it out. I don't want to use ng eject and end up in the webpack mess again.

Are there other approaches or solutions where cli@1.2.7

thank

package.json

{
  "name": "test-project",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "~4.3.3",
    "@angular/compiler": "~4.3.3",
    "@angular/core": "~4.3.3",
    "@angular/forms": "~4.3.3",
    "@angular/http": "~4.3.3",
    "@angular/animations": "~4.3.3",
    "@angular/flex-layout": "^2.0.0-beta.8",
    "@angular/material": "^2.0.0-beta.8",
    "@angular/cdk": "^2.0.0-beta.8",
    "@angular/platform-browser": "~4.3.3",
    "@angular/platform-browser-dynamic": "~4.3.3",
    "@angular/platform-server": "~4.3.3",
    "@angular/router": "~4.3.3",
    "angular2-highcharts": "~0.5.5",
    "@types/highcharts": "~4.2.57",
    "angular-2-local-storage" : "^1.0.1",
    "ngx-infinite-scroll": "^0.5.1",
    "jspdf" : "^1.3.3",
    "@types/jspdf" : "^1.1.31",
    "jspdf-autotable" : "^2.3.2",
    "html2canvas": "^0.5.0-beta4",
    "@types/html2canvas": "^0.5.34",
    "core-js": "^2.4.1",
    "jasmine-core": "^2.6.4",
    "reflect-metadata": "^0.1.10",
    "rxjs": "^5.4.1",
    "moment": "^2.18.1",
    "zone.js": "^0.8.14",
    "angular2-jwt" : "^0.2.3",
    "@types/modernizr": "3.3.0"
  },
  "devDependencies": {
    "@angular/language-service": "^4.0.0",
    "@angular/compiler-cli": "~4.3.3",
    "@angular/platform-server": "~4.3.3",
    "@angular/cli": "1.2.7",
    "hammerjs": "^2.0.8",
    "hammer-timejs" : "^1.1.0",
    "@types/hammerjs": "^2.0.34",
    "@types/jasmine": "^2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.1.1",
    "jasmine-core": "^2.6.4",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "^1.7.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-coverage": "^1.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "^1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.1.0",
    "tslib": "^1.7.1",
    "tslint": "~5.4.3",
    "typescript": "^2.4.1"
  }
}

      

+3


source to share


2 answers


My team and I are currently addressing this issue. I have tried everything from completely removing barrels in our application (I thought it was a circular dependency issue as many SO questions led me to believe)

My local environment worked well, but the new deployment had issues with the maximum number of calls.

When comparing my node modules, I noticed that zone.js is now at 0.8.17 (0.8.16 before)

So I forced 0.8.16 in my .json package and it worked .. BLAH 8 hours on this!



Hope this helps you.

EDIT

Here is the github issue: https://github.com/angular/zone.js/issues/886

At this time, there is a pull request that has been amended to resolve this issue.

+3


source


Found a solution, had some circular dependencies in my lazy loaded routes and modules.



0


source







All Articles