ionic serve watch sometimes leads to RangeError: Maximum call stack size exceeded and FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
Run watching scripts without error.
The same code that generated this errors, after stop the serve (ctrl+c, then q in terminal) and restart it (ionic serve), runned without problem. So, maybe this is not a error caused because of error in code..
Steps to reproduce:
*I was adding my pages and components(recently generated with no additional code) in app.module.ts
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
npm.debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'watch' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle ionic-hello-world@~prewatch: ionic-hello-world@
6 silly lifecycle ionic-hello-world@~prewatch: no script for prewatch, continuing
7 info lifecycle ionic-hello-world@~watch: ionic-hello-world@
8 verbose lifecycle ionic-hello-world@~watch: unsafe-perm in lifecycle true
9 verbose lifecycle ionic-hello-world@~watch: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/sciuro/Projects/teethpad/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/android-sdk/tools:/opt/android-sdk/platforms-tools
10 verbose lifecycle ionic-hello-world@~watch: CWD: /home/xxxxxx/Projects/xxxxx
11 silly lifecycle ionic-hello-world@~watch: Args: [ '-c', 'ionic-app-scripts watch' ]
12 silly lifecycle ionic-hello-world@~watch: Returned: code: 134 signal: null
13 info lifecycle ionic-hello-world@~watch: Failed to exec watch script
14 verbose stack Error: ionic-hello-world@ watch: `ionic-app-scripts watch`
14 verbose stack Exit status 134
14 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at EventEmitter.emit (events.js:172:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at ChildProcess.emit (events.js:172:7)
14 verbose stack at maybeClose (internal/child_process.js:829:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid ionic-hello-world@
16 verbose cwd /home/xxxxx/Projects/xxxxxx
17 error Linux 3.16.0-4-amd64
18 error argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "watch"
19 error node v4.5.0
20 error npm v3.10.6
21 error code ELIFECYCLE
22 error ionic-hello-world@ watch: `ionic-app-scripts watch`
22 error Exit status 134
23 error Failed at the ionic-hello-world@ watch script 'ionic-app-scripts watch'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the ionic-hello-world package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error ionic-app-scripts watch
23 error You can get information on how to open an issue for this project with:
23 error npm bugs ionic-hello-world
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls ionic-hello-world
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
Error type 1
[23:15:10] sass started ...
[23:15:10] sass finished in 10 ms
[23:15:10] bundle dev update started ...
[23:15:10] RangeError: Maximum call stack size exceeded
at isArray (native)
at deepClone (/node_modules/rollup/dist/rollup.js:157:7)
at deepClone (/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/node_modules/rollup/dist/rollup.js:165:18)
[23:15:10] sass started ...
[23:15:10] sass finished in 10 ms
JS changed: www/build/main.js
[23:15:16] bundle dev update finished in 9.37 s
[23:15:16] sass started ...
[23:15:16] sass finished in 15 ms
Error type 2
3:30:03] typescript compilation started ...
[23:30:05] bundle dev update started ...
[23:30:07] typescript compilation finished in 3.71 s
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
<--- Last few GCs --->
1049834 ms: Scavenge 1396.6 (1457.7) -> 1396.6 (1457.7) MB, 2.7 / 0 ms (+ 2.5 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
1051074 ms: Mark-sweep 1396.6 (1457.7) -> 1394.3 (1457.7) MB, 1239.2 / 0 ms (+ 3.5 ms in 2 steps since start of marking, biggest step 2.5 ms) [last resort gc].
1052314 ms: Mark-sweep 1394.3 (1457.7) -> 1396.0 (1457.7) MB, 1240.9 / 0 ms [last resort gc].
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x2a96b26b4629 <JS Object>
2: /* anonymous */(aka /* anonymous */) [/rollup/dist/rollup.js:8342] [pc=0x30f8c4fec06a] (this=0x2a96b26041b9 <undefined>,segment=0x376d29a9dea1 <JS Array[4]>)
3: arguments adaptor frame: 3->1
4: InnerArrayForEach(aka InnerArrayForEach) [native array.js:~924] [pc=0x30f8c4fc129f] (this=0x2a96b26041b9 <undefined>,bk=0x2a96b26b67f1 <JS Functi...
Aborted
npm
ERR! Linux 3.16.0-4-amd64
npm ERR! argv
"/usr/bin/nodejs" "/usr/bin/npm" "run" "watch"
npm ERR! node
v4.5.0
npm ERR! npm
v3.10.6
npm ERR! code
ELIFECYCLE
npm ERR! ionic-hello-world@ watch: `ionic-app-scripts watch`
npm ERR! Exit status 134
npm
ERR!
npm ERR!
Failed at the ionic-hello-world@ watch script 'ionic-app-scripts watch'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm
ERR! ionic-app-scripts watch
npm ERR!
You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-hello-world
npm
ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.
Which Ionic Version? 1.x or 2.x
2.1.RC.0
Run ionic info from terminal/cmd prompt: (paste output below)
Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: Debian Description: Debian GNU/Linux 8.6 (jessie)
Node Version: v4.5.0
Same thing here. It happens after a few saves...
[15:12:29] sass started ...
[15:12:29] sass finished in 10 ms
[15:24:58] typescript compilation started ...
[15:24:59] typescript compilation finished in 1.34 s
[15:25:00] bundle dev update started ...
[15:25:00] RangeError: Maximum call stack size exceeded
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:153:20)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)[15:25:00] sass started ...
[15:25:00] sass finished in 10 ms
[15:25:55] typescript compilation started ...
[15:25:57] typescript compilation finished in 1.44 s
[15:26:10] bundle dev update started ...
[15:26:10] RangeError: Maximum call stack size exceeded
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:153:20)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/Users/alamusi/test/node_modules/rollup/dist/rollup.js:165:18)
Ionic Version
2.0 RC0
System information
Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X El Capitan
Node Version: v6.6.0
Xcode version: Xcode 7.3.1 Build version 7D1014
I have Ubuntu 16.04 and too happens after a few saves:
[23:53:15] bundle dev update started ...
[23:53:15] RangeError: Maximum call stack size exceeded
at deepClone (/home/david/Documentos/Proyectos/IonicProjects/CongresoTIC/node_modules/rollup/dist/rollup.js:153:20)
at deepClone (/home/david/Documentos/Proyectos/IonicProjects/CongresoTIC/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/home/david/Documentos/Proyectos/IonicProjects/CongresoTIC/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/home/david/Documentos/Proyectos/IonicProjects/CongresoTIC/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/home/david/Documentos/Proyectos/IonicProjects/CongresoTIC/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/home/david/Documentos/Proyectos/IonicProjects/CongresoTIC/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/home/david/Documentos/Proyectos/IonicProjects/CongresoTIC/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/home/david/Documentos/Proyectos/IonicProjects/CongresoTIC/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/home/david/Documentos/Proyectos/IonicProjects/CongresoTIC/node_modules/rollup/dist/rollup.js:165:18)
at deepClone (/home/david/Documentos/Proyectos/IonicProjects/CongresoTIC/node_modules/rollup/dist/rollup.js:165:18)
[23:53:15] sass started ...
[23:53:15] sass finished in 15 ms
This has been reported here: https://github.com/driftyco/ionic-cli/issues/1433
Fix is on the way.
Hello all! Thanks for using Ionic! I am going to be closing this as a duplicate of the above linked issue.
Most helpful comment
Hello all! Thanks for using Ionic! I am going to be closing this as a duplicate of the above linked issue.