2

I am using yarn and trying to build my project.

The issue that happens is memory heap goes out of its actual size which fails the build.

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

What could be the issue? or how to identify which package might be causing this? I don't think making node options to increase memory size is a solution. That's why I am posting this here.

leonheess
  • 16,068
  • 14
  • 77
  • 112
Nika Kurashvili
  • 6,006
  • 8
  • 57
  • 123
  • What is your build command? Why do you think not expanding the JS heap size is an option? – Joe Nov 30 '19 at 19:37
  • Vote on [this proposal](https://meta.stackoverflow.com/questions/354583/disentangle-the-yarn) to ease the tag confusion. – leonheess Feb 10 '20 at 12:29

1 Answers1

3

It is not evident what the problem could be with just this error message. I did a quick search and found a somewhat similar issue with a Vue project: Yarn build - Crashes error JavaScript heap out of memory. There are two suggestions in the post. Can you look into applying these possible fixes to your app:

  • Update Node.
  • Look out for a dependency loop in your package.json file.

Maybe a little more context on the environment of your application could be useful. Which version of Node are you using? Can you add the content of your package file to the question?

Yves Gurcan
  • 1,096
  • 1
  • 10
  • 25