ionic-team / ionic-team/ionic-cli

Webpack Started.... CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Abierto
#2,815 0 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
2k
Forks
682
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**Ionic version:**
Ionic Framework : ionic-angular 3.7.1

**I'm submitting a ...**
[X ] bug report

**Current behavior:**
I am able to run **ionic serve** without any issues. However when attempt to build my progressive web app production files using **npm run ionic:build --prod** OR **ionic build --prod** the ionic-app-scripts 3.0.0 runs but then halts at 'webpack started...' After a minute or so I then get an 'allocation failure scavenge might not succeed'. The full error is provided below.

I am using a MacOS Sierra, 3.3 GHz Intel Core i5 w/ 16gb ram. In addition I am using Node v8.6.0 and NPM 5.3.0. My ionic info is also provided below. All are executed within terminal window. Note I do have a big app with 30+ components.

**Expected behavior:**
Should compile and build minified production files.

**Steps to reproduce:**
Execute **npm run ionic:build --prod** within terminal.

**Related code:**
```
mgt-mobile core$ npm run ionic:build --prod

> mgt-mobile@0.0.1 ionic:build /Users/core/www/mgt-mobile
> ionic-app-scripts build

[11:14:52] ionic-app-scripts 3.0.0
[11:14:52] build prod started ...
[11:14:52] clean started ...
[11:14:52] clean finished in 2 ms
[11:14:52] copy started ...
[11:14:52] deeplinks started ...
[11:14:53] deeplinks finished in 416 ms
[11:14:53] ngc started ...
[11:14:55] copy finished in 2.54 s
[11:15:07] ngc finished in 14.74 s
[11:15:07] preprocess started ...
[11:15:08] preprocess finished in 83 ms
[11:15:08] webpack started ...

<--- Last few GCs --->

[3044:0x103001600] 114662 ms: Mark-sweep 1416.2 (1630.1) -> 1416.2 (1630.1) MB, 247.1 / 0.0 ms allocation failure scavenge might not succeed
[3044:0x103001600] 114908 ms: Mark-sweep 1416.2 (1630.1) -> 1416.1 (1605.1) MB, 245.9 / 0.0 ms last resort
[3044:0x103001600] 115166 ms: Mark-sweep 1416.1 (1605.1) -> 1416.1 (1599.1) MB, 257.0 / 0.0 ms last resort

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x1bdb7c028799
1: DoJoin(aka DoJoin) [native array.js:~95] [pc=0x2c83ed554b64](this=0x11b6a7e82311 ,p=0x3394573f7381 ,q=303,E=0x11b6a7e823b1 ,A=0x11b6a7ed79a9 ,z=0x11b6a7e82421 )
2: Join(aka Join) [native array.js:~120] [pc=0x2c83ed69aa69](this=0x11b6a7e82311 ,p=0x3394573f7381 ,q=303,A=0x11b6a7ed79a9 ,z=0x11b6a7e...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [/usr/local/bin/node]
2: node::FatalException(v8::Isolate*, v8::Local, v8::Local) [/usr/local/bin/node]
3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
4: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/usr/local/bin/node]
5: v8::internal::Runtime_StringBuilderJoin(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
6: 0x2c83ed3846fd
```
**Ionic info:** (run `ionic info` from a terminal/cmd prompt and paste output below):

```
cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils : 1.13.1
ionic (Ionic CLI) : 3.13.2

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 3.0.0
Cordova Platforms : ios 4.4.0
Ionic Framework : ionic-angular 3.7.1

System:

ios-deploy : 1.9.1
Node : v8.6.0
npm : 5.3.0
OS : macOS Sierra
Xcode : Xcode 9.0 Build version 9A235

Misc:

backend : pro
```
**Other Information:**
Related issue https://github.com/ionic-team/ionic-cli/issues/2670. However in my example I can run Ionic Serve no issues as well serve the ionic build in Ionic Pro. My error occurs when I try to run **npm run ionic:build --prod** OR **ionic build --prod**

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.