Reputation: 664
I am trying to launch my nodejs app on heroku. But everytime it launches it crashes with the error below. People keep mentioning that i have to make some port fixes, but I dont understand where and how? Can someone help me debug this crashing issue.. If i run this locally using npm start
it works fine.
Here is my repo: https://github.com/Gorgutzz/portfolio-site
2020-08-25T02:29:52.559666+00:00 heroku[web.1]: State changed from crashed to starting
2020-08-25T02:30:03.658131+00:00 heroku[web.1]: Starting process with command `npm start`
2020-08-25T02:30:06.506095+00:00 app[web.1]:
2020-08-25T02:30:06.506170+00:00 app[web.1]: > [email protected] start /app
2020-08-25T02:30:06.506176+00:00 app[web.1]: > react-scripts start
2020-08-25T02:30:06.506181+00:00 app[web.1]:
2020-08-25T02:30:09.243945+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.17.138.30/
2020-08-25T02:30:09.244281+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-08-25T02:30:09.244350+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-08-25T02:30:09.244420+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-08-25T02:30:09.244654+00:00 app[web.1]: Starting the development server...
2020-08-25T02:30:09.244655+00:00 app[web.1]:
2020-08-25T02:30:09.336466+00:00 heroku[web.1]: Process exited with status 0
2020-08-25T02:30:09.382429+00:00 heroku[web.1]: State changed from starting to crashed
2020-08-25T02:30:17.664264+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=leo-port123.herokuapp.com request_id=d96f2dd2-7ebf-4123-a30a-2a499c5e826f fwd="24.102.208.138" dyno= connect= service
= status=503 bytes= protocol=http
2020-08-25T02:30:18.664310+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=leo-port123.herokuapp.com request_id=f5a14315-78c3-41b9-b90c-ae748f7f4800 fwd="24.102.208.138" dyno= conne
ct= service= status=503 bytes= protocol=http
Upvotes: 2
Views: 688
Reputation: 252
Heroku runs on a port that is randomly assigned every time the dyno starts. You have three options:
Upvotes: 1