question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): Error: Maximum call stack size exceeded

See original GitHub issue

🐞 Bug report

Command (mark with an x)

  • new
  • [ x] build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No

Description

A clear and concise description of the problem...

I separated my code into modules and now I’m getting the following errors with no other explanation. I tried cleaning out the node_modules folder, cleared cache, and delete the package-lock file.

I also confirmed that I don’t have overlapping module imports.

πŸ”₯ Exception or Error




./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Maximum call stack size exceeded

./src/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Maximum call stack size exceeded

🌍 Your Environment




{
  "name": "src",
  "version": "1.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "start-dev": "ng serve --ssl --ssl-key xxxx.key --ssl-cert xxxxx.crt",
    "build": "ng build --configuration=production",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^14.0.6",
    "@angular/common": "^14.0.6",
    "@angular/compiler": "^14.0.6",
    "@angular/core": "^14.0.6",
    "@angular/forms": "^14.0.6",
    "@angular/platform-browser": "^14.0.6",
    "@angular/platform-browser-dynamic": "^14.0.6",
    "@angular/router": "^14.0.6",
    "@auth0/auth0-angular": "^1.10.0",
    "@fortawesome/angular-fontawesome": "^0.11.1",
    "@fortawesome/fontawesome-svg-core": "^6.1.1",
    "@mobiscroll/angular": "^4.10.9",
    "@popperjs/core": "^2.11.5",
    "animate": "^1.0.0",
    "animate.css": "^4.1.1",
    "bootstrap": "^5.1.3",
    "core-js": "^3.23.3",
    "rxjs": "~7.4.0",
    "twilio-video": "^2.21.3",
    "util": "^0.12.4",
    "webpack": "^5.73.0",
    "wowjs": "^1.1.3",
    "zone.js": "^0.11.6"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^14.0.6",
    "@angular-eslint/builder": "14.0.2",
    "@angular-eslint/eslint-plugin": "14.0.2",
    "@angular-eslint/eslint-plugin-template": "14.0.2",
    "@angular-eslint/schematics": "14.0.2",
    "@angular-eslint/template-parser": "14.0.2",
    "@angular/cli": "^14.0.6",
    "@angular/compiler-cli": "^14.0.6",
    "@types/jasmine": "^4.0.3",
    "@types/jasminewd2": "^2.0.10",
    "@types/node": "^18.0.0",
    "@types/offscreencanvas": "^2019.7.0",
    "@typescript-eslint/eslint-plugin": "5.29.0",
    "@typescript-eslint/parser": "5.29.0",
    "eslint": "^8.18.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-prettier": "^4.2.1",
    "jasmine-core": "~4.2.0",
    "karma": "^6.4.0",
    "karma-chrome-launcher": "^3.1.1",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "^5.1.0",
    "karma-jasmine-html-reporter": "~2.0.0",
    "prettier": "^2.7.1",
    "prettier-eslint": "^15.0.1",
    "ts-node": "~10.8.1",
    "tslib": "^2.4.0",
    "typescript": "~4.7.4"
  }
}

tsconfig:
{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "forceConsistentCasingInFileNames": true,
    "esModuleInterop": true,
    "resolveJsonModule": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2017",
    "module": "es2020",
    "typeRoots": ["./types", "./node_modules/@types"],
    "lib": ["es2018", "dom"]
  },
  "angularCompilerOptions": {
    "enableI18nLegacyMessageIdFormat": false,
    "strictInjectionParameters": true,
    "fullTemplateTypeCheck": true,
    "strictTemplates": true
  }
}

Anything else relevant?

No

no

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17

github_iconTop GitHub Comments

1reaction
richardR59commented, Aug 1, 2022

@alan-agius4 & @fitprotracker

I did a refactoring of all the modules as a standalone component and the project now works.

1reaction
SebaInfantecommented, Jul 28, 2022

same problem. When working on a module it shows these errors. This module is the most complex, since it activates cameras and QR readers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript RangeError: Maximum Call Stack Size Exceeded
The JavaScript RangeError: Maximum call stack size exceeded is an error that occurs when there are too many function calls, or if a...
Read more >
javascript - Maximum call stack size exceeded error
It means that somewhere in your code, you are calling a function which in turn calls another function and so forth, until you...
Read more >
Getting Module build failed: RangeError: Maximum call stack ...
I have just gone upgraded my Ionic 2 app to Ionic 3, all of framework, Ionic native, and the CLI. I now have...
Read more >
JavaScript Error: Maximum Call Stack Size Exceeded
What is the Maximum Call Stack Size Exceeded error? You can learn more about this JavaScript error and how to fix it in...
Read more >
RangeError: Maximum call stack size exceeded
Hi group,. I could use some help. When running a build with gulp for the first time, I'm getting the error "RangeError:Β ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found