1

When building my typescript project, i.e. I run npm run build, and the script looks like "build": "webpack", I get the error below.

It complains about being out of memory, even though vscode only consumes about 2GB of RAM, and I still have plenty (10+GB) left.

Any idea what could be causing this? Clearing node_modules or installing other webpack versions didn't help. I've also googled for an entire day already...

0: ExitFrame [pc: 00000059E33DC5C1]
Security context: 0x00aa77a1e6e1 <JSObject>
    1: getIntersectionType(aka getIntersectionType) [0000005345B7BA31] [<...>\node_modules\typescript\lib\typescript.js:~37293] [pc=00000059E43C3A49](this=0x017ebc8026f1 <undefined>,types=0x0276c2202699 <JSArray[5]>,aliasSymbol=0x017ebc8026f1 <undefined>,aliasTypeArguments=0x017ebc8026f1 <undefined>)
    2: arguments adaptor frame: 1->3
...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 00007FF6024B08AA v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4810
 2: 00007FF602489C46 node::MakeCallback+4518
 3: 00007FF60248A630 node_module_register+2160
 4: 00007FF60271AA4E v8::internal::FatalProcessOutOfMemory+846
 5: 00007FF60271A97F v8::internal::FatalProcessOutOfMemory+639
 6: 00007FF602C58984 v8::internal::Heap::MaxHeapGrowingFactor+11476
 7: 00007FF602C4F0E7 v8::internal::ScavengeJob::operator=+25543
 8: 00007FF602C4D65C v8::internal::ScavengeJob::operator=+18748
 9: 00007FF602C565D7 v8::internal::Heap::MaxHeapGrowingFactor+2343
10: 00007FF602C56656 v8::internal::Heap::MaxHeapGrowingFactor+2470
11: 00007FF6027F9457 v8::internal::Factory::NewFillerObject+55
12: 00007FF60289113A v8::internal::WasmJs::Install+29530
13: 00000059E33DC5C1
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! <project name> build: `webpack`
npm ERR! Exit status 134
JBSnorro
  • 6,048
  • 3
  • 41
  • 62

1 Answers1

0

It turned out that one of the dependencies depends on a higher typescript version than I was referencing (in my case 3.3.3333, whereas I was referencing 3.0.3).

When I upgraded the typescript dependency in my package.json, the error went away and I could build again.

JBSnorro
  • 6,048
  • 3
  • 41
  • 62