0

I've encountered a problem that I think I understand the solution (paying for more bandwidth on Heroku), but I do not understand the origin of the problem and it is driving me crazy. I would appreciate it if anyone can help me figure it out! Hopefully, others that are in a similar situation in the future can refer back to this.

I'm encountering this error which is similar to this error here: Heroku server crashes with "JavaScript heap out of memory" when deploying 'react-admin' app

I understand that the free tier of Heroku limits me to around 512 MB of memory, and I've set my Heroku config node options like this:

NODE_OPTIONS: --max_old_space_size=5120

All being said and done, I ran my application locally and inspected the memory heap which only uses up a maximum of 20 MB of memory. Weird. It's nothing close to the 512 MB limit Heroku imposes on me?!

What tidbit of information am I missing?

Pajke
  • 347
  • 1
  • 3
  • 12

1 Answers1

0

I had this error and installed the server library with this command in terminal:

npm i --save serve

and then changed some of the lines in my package.json file to under the "scripts" section.

    "start": "serve -s build",
    "dev": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

Hope this works for you

amduck
  • 21
  • 5