node.js - Heroku: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory even after changing NODE OPTIONS
I am deploying a Shopify App to Heroku and the build fails with:Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory.
I already tried setting NODE options like this:
heroku config:set NODE_OPTIONS="--max_old_space_size=2560" -a [app_name]
This did not work either, even after taking memory as high as 8192. I am running a 2x dyno with 1GB memory. Here is an excerpt from my package.json:
"scripts": {
"shopify": "shopify",
"build": "shopify app build",
"dev": "shopify app dev",
"info": "shopify app info",
"generate": "shopify app generate",
"start": "NODE_ENV=production node ./web/index.js",
"deploy": "shopify app deploy"
},
I suspected increasing the max_old_space or changing to a paid dyno would help, but no luck.
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.