Wednesday 1 September 2021

Application Error - Heroku [Solved]

ReactJS app runs locally without any error, but on heroku the app crashes when deployed:

2020-03-25T10:12:12.437479+00:00 app[web.1]: > steptracker-admin@0.1.0 start /app
2020-03-25T10:12:12.437480+00:00 app[web.1]: > react-scripts start
2020-03-25T10:12:12.437480+00:00 app[web.1]:
2020-03-25T10:12:15.473839+00:00 heroku[web.1]: State changed from starting to up
2020-03-25T10:12:15.444327+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.18.165.2/
2020-03-25T10:12:15.444903+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-03-25T10:12:15.445032+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-03-25T10:12:15.445120+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-03-25T10:12:15.445390+00:00 app[web.1]: Starting the development server...
2020-03-25T10:12:15.445391+00:00 app[web.1]:
2020-03-25T10:12:15.642416+00:00 heroku[web.1]: State changed from up to crashed
2020-03-25T10:12:15.626641+00:00 heroku[web.1]: Process exited with status 0
Solution:
Install serve package:
npm install --save serve
Add serve in package.json
 "scripts": {
    "start""serve -s build",
    "build""react-scripts build",
    "test""react-scripts test",
    "eject""react-scripts eject"
  },

No comments:

Post a Comment