search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Angular CLI - Module build failed: RangeError: Maximum call stack size exceeded

Asked by Josh Hurst
6 years ago.

Dependancies:
"typescript": "2.6.2",
"@angular/cli": "1.7.4",
"@angular/compiler-cli": "5.2.10",
"@angular/compiler": "5.2.10",
"daypilot-pro-angular": "https://npm.daypilot.org/daypilot-pro-angular/trial/8.4.3056.tar.gz"

Issue:
Running "ng build --prod" (uses aot and build-optimizer) causes the following error:

ERROR in ./node_modules/daypilot-pro-angular/daypilot-angular.min.js
Module build failed: RangeError: Maximum call stack size exceeded

Issue seems to happen during the "build-optimizer" phase of the ng cli build process. If build-optimizer is disabled, then there is no issue.

Answer posted by Dan Letecky [DayPilot]
6 years ago.

I've tested a clean new project generated using Angular CLI 1.7.4 and it works fine. After adding DayPilot Pro 8.4.3056

npm install https://npm.daypilot.org/daypilot-pro-angular/trial/8.4.3056.tar.gz --save

the package.json looks like this:

{
  "name": "angular-scheduler",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "core-js": "^2.4.1",
    "daypilot-pro-angular": "https://npm.daypilot.org/daypilot-pro-angular/trial/8.4.3056.tar.gz",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "~1.7.4",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "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": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }
}

I've also tried to use the specific versions that you mention. This also works fine:

{
  "name": "angular-scheduler",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "5.2.10",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "core-js": "^2.4.1",
    "daypilot-pro-angular": "https://npm.daypilot.org/daypilot-pro-angular/trial/8.4.3056.tar.gz",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "~1.7.4",
    "@angular/compiler-cli": "5.2.10",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "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": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "2.6.2"
  }
}

I strongly recommend sticking with the defaults generated by Angular CLI.

Also, trying to upgrade an existing project to a higher version of Angular CLI often results in compilation errors. You can try to delete node_modules and run "npm install" again. If that fails, you'll probably have to generate a new project and copy your source files to it - that is the only reliable way to upgrade, unfortunately.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.