How to fix “FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory” error

前端 未结 6 518
再見小時候
再見小時候 2020-12-15 17:52

I\'m trying to deploy a reactjs application to heroku. While compiling assets, the build fails and produces this error:

-----> Ruby app detected
----->         


        
6条回答
  •  眼角桃花
    2020-12-15 18:32

    I had a similar heap allocation error while deploying to Heroku. The app would still build correctly but would not load in the browser. Heroku logs would show me this: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

    After trying a dozen different things this seemed to work in package.json:

     "start": "react-scripts --max_old_space_size=4096 start",
     "build": "react-scripts --max_old_space_size=4096 build",
    

提交回复
热议问题