angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng add @angula/pwa Maximum call stack size exceeded error

Open gautamkrishnar opened this issue 8 years ago • 11 comments

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

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

Versions

node --version

v10.4.1

npm --version

6.4.1

ng --version


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

Angular CLI: 7.0.4
Node: 10.4.1
OS: darwin x64
Angular: 7.0.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.10.4
@angular-devkit/build-angular     0.10.4
@angular-devkit/build-optimizer   0.10.4
@angular-devkit/build-webpack     0.10.4
@angular-devkit/core              7.0.4
@angular-devkit/schematics        7.0.4
@angular/cli                      7.0.4
@angular/pwa                      0.11.0-beta.1
@ngtools/webpack                  7.0.4
@schematics/angular               7.0.4
@schematics/update                0.10.4
rxjs                              6.3.3
typescript                        3.1.6
webpack                           4.19.1

Repro steps

Create a new app with latest angular CLI. Use the command below to add @angular/pwa

ng add @angular/pwa

The log given by the failure

Installing packages for tooling via npm.

+ @angular/[email protected]
updated 1 package and audited 47652 packages in 12.267s
found 0 vulnerabilities

Installed packages for tooling via npm.
Maximum call stack size exceeded

Desired functionality

ng add @angular/cli should work

Mention any other details that might be useful

gautamkrishnar avatar Nov 11 '18 02:11 gautamkrishnar

Hi, it's odd that ng --version stats that your @angular/pwa is 0.11.0-beta.1

However, this issue is duplicate of #12914

alan-agius4 avatar Nov 11 '18 09:11 alan-agius4

👍 thanks. Sorry for the beta version i actually tried ng add @angular/pwa@next before copying the log. Thats why.

gautamkrishnar avatar Nov 11 '18 13:11 gautamkrishnar

if you delete the node_modules it works fine.

marcobaccaro avatar Dec 11 '18 22:12 marcobaccaro

I am new with angular and I have same(probably similar) issue. During one of the free tutorial (Build your First Angular PWA from Scratch (Angular 6 PWA Tutorial)) https://www.youtube.com/watch?v=othhfZ0mGjU, I ran the command to install the functionality for PWA as the tutor said:

=> ng add @angular/pwa

and I got the following message:

Installing packages for tooling via npm.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ @angular/[email protected]
updated 1 package and audited 47713 packages in 11.085s
found 0 vulnerabilities

Installed packages for tooling via npm.
Maximum call stack size exceeded

Would anyone know what should i do? @marcobacaro, is it a good advice to delete the 'node modules'?

I am new to any advice would be much appreciated.

kenvng avatar Dec 24 '18 23:12 kenvng

@kenvng the folder called "node_modules" is where all your dependencies are installed and the installation depends of the "package.json" file where you can specify which modules your project needs, there are some modules which are compiled at installation time so delete your node_modules folder is not bad, obviously you need to reinstall the packages again to have a project working correctly. In this case removing the node_modules folder solves the console error at the installation time but for my angular 7.X project the ServiceWorker is not working.

hectomg avatar Dec 27 '18 20:12 hectomg

This issue should be reopened. The issue needs to be addressed with a better message from the cli and/or a fix for exceeding the call stack maximum. Deleting node_modules is not a good workaround.

Buttars avatar Jan 02 '19 19:01 Buttars

@Buttars Please check #12914

gautamkrishnar avatar Jan 02 '19 20:01 gautamkrishnar

@hectomg Hi, Hecto. I figured it out. so what happen was that I had a mix-matched package installed. The tutorial I was doing was not clear and when I installed it to global -g and not local. I went back deleted it and redo it with: : npm install ng update --all Which did the trick for me. Thank you again for everyone help and advices

kenvng avatar Jan 03 '19 01:01 kenvng

Hi, What worked for me was (1) deleting the node_modules folder first and (2) 'ng add @angular/pwa' and (3) 'npm install'

After that it worked. Hope this helps someone :)

FvdG avatar Jan 17 '19 10:01 FvdG

Thank you @FvdG that solved the problem for me!

dcarr178 avatar Jan 19 '19 23:01 dcarr178

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.