Vue CLI JavaScript heap out of memory


#1

Upgrading from Vue CLI 2 to Vue CLI 3
Running npm run build
Is this a known error?

vue-cli-service build
/ Building for production…
<— Last few GCs —>

[12068:00000216D31987E0]    37723 ms: Mark-sweep 671.9 (729.8) -> 671.8 (686.3) MB, 2084.3 / 0.0 ms  (average mu = 0.562, current mu = 0.000) last resort GC in old space requested
[12068:00000216D31987E0]    38173 ms: Mark-sweep 671.8 (686.3) -> 671.8 (685.8) MB, 449.4 / 0.0 ms  (average mu = 0.486, current mu = 0.000) last resort GC in old space requested


<--- JS stacktrace --->

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

    0: ExitFrame [pc: 000002ADD985C6C1]
Security context: 0x03161ad1e549 <JSObject>
    1: processNodeList(aka processNodeList) [00000036DDCB43E9] [C:\source\customer\Portal\node_modules\eslint-plugin-vue\lib\utils\indent-common.js:~354] [pc=000002ADD9DCFAE4](this=0x0002d27026f1 <undefined>,nodeList=0x0036ddcb4461 <JSArray[4]>,leftToken=0x0036ddcb4429 <Object map = 0000016318225B99>,rightToken=0x0002d27022b1 <null>,offset=1,alignVerticall...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 00007FF7E1BA3D05
 2: 00007FF7E1B7DD46
 3: 00007FF7E1B7E610
 4: 00007FF7E1FE48DE
 5: 00007FF7E1FE480F
 6: 00007FF7E1F301A4
 7: 00007FF7E1F2DE08
 8: 00007FF7E2053388
 9: 00007FF7E2053D02
10: 00007FF7E209816B
11: 00007FF7E24A87D0
12: 000002ADD985C6C1
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! portal@0.0.11 build: `vue-cli-service build`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the portal@0.0.11 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\my-name\AppData\Roaming\npm-cache\_logs\2018-11-09T14_03_34_763Z-debug.log

#2

We haven’t seen this so far I think, no


#3

adding more info


#4

i’m having the same issues too!


#5

For me this was based on lint errors (a whole lot of it)

In the new project created for upgrading the CLI this was added:

  'extends': [
    'plugin:vue/strongly-recommended',
    '@vue/standard'
  ],

This created a lot of error messages.
I tried to run npm run lint --fix but got the same out of memory error

I then reduced the lint level to essential.
And run:
npm run lint --fix the run went thru and
I got a lot of errors in the console
After som manual linting I got rid of the errors and the
npm run build command went thru without a out of memory exception.

I will now upgrade to strongly-recommended and repeate the process


#6

I have the same problems since few weeks ago with a couple of proyects. The way I solved it is by adding Swap memory to my server (I use to run ‘npm run build’ there). But since I updated both my code (just components) and NPM on the server, it happens more often. Sometimes restarting the server and compiling works, sometimes it doesnt.