React app runs locally, crashes when on Heroku error code=H10

Just npm i serve to install serve then or you could use yarn instead of npm

You can change your scripts in package.json file, it seemed to be caused by update by react.

"scripts": {
"dev": "react-scripts start",
"start": "serve -s build",
"build": "react-scripts build",
"heroku-postbuild": "npm run build"}

Hope it fixes your problem.


I had the same problem, but the solution above did not work for my react app in Heroku. I have updated the build pack to create-react-app, and it worked for me.

heroku buildpacks:set mars/create-react-app


1.) npm install serve --save or yarn install serve --save in your terminal

"scripts": {
"dev": "react-scripts start",
"start": "serve -s build",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"heroku-postbuild": "npm run build"
}

2.) copied the above code in place of previous code "scripts" in my package.json file

3.) git commit -am "new update"

4.) git push heroku master

  • Note: the common problem is missing the first step.