Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Rollup Crashes on build --prod #779

Closed
CoDanny opened this issue Feb 23, 2017 · 8 comments
Closed

Rollup Crashes on build --prod #779

CoDanny opened this issue Feb 23, 2017 · 8 comments

Comments

@CoDanny
Copy link

CoDanny commented Feb 23, 2017

using ionic build --prod crashes on rollup.

Which @ionic/app-scripts version are you using?

1.1.4

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

[23:23:39]  ionic-app-scripts 1.1.4 
[23:23:39]  build prod started ... 
[23:23:39]  clean started ... 
[23:23:39]  clean finished in 2 ms 
[23:23:39]  copy started ... 
[23:23:39]  ngc started ... 
[23:23:52]  ngc finished in 13.04 s 
[23:23:52]  preprocess started ... 
[23:23:52]  optimization started ... 
[23:23:53]  copy finished in 13.21 s 
[23:24:02]  optimization finished in 10.11 s 
[23:24:02]  preprocess finished in 10.12 s 
[23:24:02]  rollup started ... 
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 
<--- Last few GCs --->

   52711 ms: Mark-sweep 1277.9 (1434.3) -> 1277.9 (1434.3) MB, 897.3 / 0.0 ms [allocation failure] [GC in old space requested].
   53567 ms: Mark-sweep 1277.9 (1434.3) -> 1277.9 (1434.3) MB, 856.3 / 0.0 ms [allocation failure] [GC in old space requested].
   54546 ms: Mark-sweep 1277.9 (1434.3) -> 1287.1 (1413.3) MB, 978.0 / 0.0 ms [last resort gc].
   55498 ms: Mark-sweep 1287.1 (1413.3) -> 1296.7 (1413.3) MB, 951.8 / 0.0 ms [last resort gc].


<--- JS stacktrace --->

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

Security context: 0x2086703cfb51 <JS Object>
    1: /* anonymous */(aka /* anonymous */) [/Users/arroyo/3dagogo-repos/AstroPrint-Mobile/node_modules/rollup/dist/rollup.js:~8996] [pc=0x38da0b1c5824] (this=0x208670304381 <undefined>,segment=0x2087b0cd0c79 <JS Array[4]>)
    2: arguments adaptor frame: 3->1
    3: InnerArrayForEach(aka InnerArrayForEach) [native array.js:~935] [pc=0x38da0b3beeef] (this=0x208670304381 <undefined>,bq=0x15e3f5c...

node::Abort() [/usr/local/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
 4: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/local/bin/node]
 5: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
 6: 0x38da090079a7
 7: 0x38da0b1c5824
 8: 0x38da09009895
Your system information:

Cordova CLI: 6.5.0 
Ionic Framework Version: 2.1.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.4
ios-deploy version: 1.9.0 
ios-sim version: 5.0.8 
OS: OS X El Capitan
Node Version: v6.10.0
Xcode version: Xcode 8.2 Build version 8C38
@CoDanny
Copy link
Author

CoDanny commented Feb 23, 2017

This pull request fixes my issue #768

@ericstu
Copy link

ericstu commented Feb 26, 2017

I have similar issue. The pull request #768 can't works for me.


[12:43:29] ionic-app-scripts 1.1.4
[12:43:29] build prod started ...
[12:43:29] clean started ...
[12:43:29] clean finished in 3 ms
[12:43:29] copy started ...
[12:43:29] ngc started ...
[12:44:21] ngc finished in 51.94 s
[12:44:21] preprocess started ...
[12:44:21] optimization started ...
[12:44:22] copy finished in 52.58 s
[12:44:45] optimization finished in 23.83 s
[12:44:45] preprocess finished in 23.84 s
[12:44:45] webpack started ...
[12:46:11] webpack finished in 85.80 s
[12:46:11] sass started ...
[12:46:11] transpile bundle started ...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "E:\Program Files\nodejs\node.exe" "E:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: ionic-app-scripts build --prod
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the [email protected] build script 'ionic-app-scripts build --prod'.
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 myapp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts build --prod
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs myapp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls myapp
npm ERR! There is likely additional logging output above.

@numerized
Copy link

Same for me with webpack.

? What platform would you like to build (ios, android): ios
  Running app-scripts build: --prod --iscordovaserve --nobrowser
[15:05:47]  build prod started ...
[15:05:47]  clean started ...
[15:05:47]  clean finished in 1 ms
[15:05:47]  copy started ...
[15:05:47]  ngc started ...
[15:06:19]  ngc finished in 31.93 s
[15:06:19]  preprocess started ...
[15:06:19]  optimization started ...
[15:06:42]  optimization finished in 23.19 s
[15:06:42]  preprocess finished in 23.19 s
[15:06:42]  webpack started ...
[15:08:40]  webpack finished in 117.31 s
[15:08:40]  sass started ...
[15:08:40]  transpile bundle started ...

<--- Last few GCs --->

  222834 ms: Mark-sweep 1314.5 (1434.4) -> 1314.5 (1434.4) MB, 1012.8 / 0 ms [allocation failure] [GC in old space requested].
  223872 ms: Mark-sweep 1314.5 (1434.4) -> 1314.5 (1434.4) MB, 1038.8 / 0 ms [allocation failure] [GC in old space requested].
  224893 ms: Mark-sweep 1314.5 (1434.4) -> 1314.5 (1434.4) MB, 1020.6 / 0 ms [last resort gc].
  225904 ms: Mark-sweep 1314.5 (1434.4) -> 1314.5 (1434.4) MB, 1010.6 / 0 ms [last resort gc].


<--- JS stacktrace --->

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

Security context: 0x26aa7f7c9e59 <JS Object>
    2: binarySearch [/Users/numerized/Work/00_Github/vitapp-ionic2-couch/node_modules/typescript/lib/typescript.js:~1327] [pc=0x3081e34e6bb9] (this=0x1cbfa13f43e9 <an Object with map 0x2bc84d0aac81>,array=0x37e6926252d1 <JS Array[256164]>,value=13464495,comparer=0x26aa7f704189 <undefined>)
    3: arguments adaptor frame: 2->3
    4: computeLineAndCharacterOfPosition [/Users/numerized/Work/00_Gi...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
Abort trap: 6

@numerized
Copy link

numerized commented Feb 28, 2017

Same after upgrading to latest CLI and latest app-script I have to launch the build manually like this:

node --max-old-space-size=8192 ./node_modules/.bin/ionic-app-scripts build --prod

@larssn
Copy link

larssn commented Mar 1, 2017

ionic build ios --aot --bundler rollup

Mine also fails, but with:

[18:22:32]  rollup failed: Unexpected token 
[18:22:32]  ionic-app-script task: "build" 
[18:22:32]  Error: Unexpected token 
Error: Unexpected token
    at error (./node_modules/rollup/dist/rollup.js:170:12)
    at Module.error$1 [as error] (./node_modules/rollup/dist/rollup.js:7997:2)
    at tryParse (./node_modules/rollup/dist/rollup.js:7700:10)
    at new Module (./node_modules/rollup/dist/rollup.js:7735:14)
    at ./node_modules/rollup/dist/rollup.js:9481:17

@speedfl
Copy link

speedfl commented Mar 5, 2017

Having the same issue!

[13:30:12]  rollup started ...
[13:30:45]  rollup:  commonjs-proxy:D:\xxx\node_modules\@angular\core\index.js
            has issued a warning: 'default' is not exported by 'node_modules\@angular\core\index.js'
[13:30:45]  rollup:  commonjs-proxy:D:\xxx\node_modules\@angular\http\index.js
            has issued a warning: 'default' is not exported by 'node_modules\@angular\http\index.js'
[13:30:46]  rollup:  commonjs-proxy:D:\xxx\node_modules\@angular\common\index.js
            has issued a warning: 'default' is not exported by 'node_modules\@angular\common\index.js'
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

However I am getting this issue only when using a custom rollup config for pouchDB by following:
https://ionicframework.com/docs/v2/resources/app-scripts/

Tried with the content of the PR and even with 8192...

I think the issue is coming from the extend....

@RodolfoSilva
Copy link

Having the same issue!

[07:37:12]  rollup update started ...
[07:37:14]  rollup: commonjs-proxy:/home/rodolfosilva/htdocs/ionic2/node_modules/@angular/http/index.js has
            issued a warning: 'default' is not exported by 'node_modules/@angular/http/index.js'
[07:37:14]  rollup: commonjs-proxy:/home/rodolfosilva/htdocs/ionic2/node_modules/@angular/core/index.js has
            issued a warning: 'default' is not exported by 'node_modules/@angular/core/index.js'
[07:37:19]  rollup update finished in 7.39 s

@danbucholtz
Copy link
Contributor

This should be resolved now.

Thank,s
Dan

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants