Monday, April 9, 2018

Eslint - FatalProcessOutOfMemory


FatalProcessOutOfMemory
FATAL ERROR CALL AND RETRY LAST
allocation failed - Javascript heap out of memory

I am getting this error after run *yarn run lint* for my create-react-app project.


This is due to the gigantic bundle.

I have something like this:

"lint": "eslint --ext .jsx --ext .js ."

Fix: change that line for this one:

"lint": "./node_modules/.bin/eslint . --ext ./src/*.js --ext ./src/*.jsx"

or you can use this ones:

"lint": "eslint -- --max_old_space_size=4096 --ext .jsx --ext .js ."

"lint": "./node_modules/.bin/eslint --ext .jsx --ext .js ./src"

1024 #increase to 1gb
2048 #increase to 2gb
3072 #increase to 3gb
4096 #increase to 4gb
5120 #increase to 5gb
6144 #increase to 6gb
7168 #increase to 7gb
8192 #increase to 8gb

That worked for me. Just make sure to enter your folder name, the mine is *src*

No comments:

Post a Comment