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

前端 未结 6 515
再見小時候
再見小時候 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:47

    its because more "js" files in your react Application. You can build your application after making some Changes in package.json like below of code:

    "scripts": {
            "start": "react-scripts --max_old_space_size=4096 start",
            "build": "react-scripts --max_old_space_size=4096 build",
            "test": "react-scripts test",
            "eject": "react-scripts eject"
          },
    

提交回复
热议问题