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

前端 未结 5 1631
醉酒成梦
醉酒成梦 2020-12-16 18:26

The app runs fine after an \'npm start\' in windows, but when I pull from github into Heroku I just get an error.

package.json:

{
  \"name\": \"tic         


        
5条回答
  •  一向
    一向 (楼主)
    2020-12-16 19:05

    I face the same problem, it has worked for me.

    add "serve" to application.

    example: npm add serve or yarn add serve

    after change scripts in package.json

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

提交回复
热议问题