'Heroku Node Crash: at=error code=H10 desc="App crashed" method=GET path="/"
I am receiving the following Heroku logs when trying to deploy my node app. I cannot figure out the cause of this. I'm guessing this has to do with the favicon link in my index.html
file?
Heroku Log
2020-03-25T14:07:37.323633+00:00 app[web.1]: > react-scripts start
2020-03-25T14:07:37.323633+00:00 app[web.1]:
2020-03-25T14:07:40.667543+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.16.68.202/
2020-03-25T14:07:40.668023+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-03-25T14:07:40.668162+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-03-25T14:07:40.668280+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-03-25T14:07:40.668531+00:00 app[web.1]: Starting the development server...
2020-03-25T14:07:40.668533+00:00 app[web.1]:
2020-03-25T14:07:40.815780+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-25T14:07:40.794329+00:00 heroku[web.1]: Process exited with status 0
2020-03-25T16:50:20.606050+00:00 heroku[web.1]: State changed from crashed to starting
2020-03-25T16:50:29.481448+00:00 heroku[web.1]: Starting process with command `npm start`
2020-03-25T16:50:32.126241+00:00 app[web.1]: npm WARN npm npm does not support Node.js v12.16.1
2020-03-25T16:50:32.126628+00:00 app[web.1]: npm WARN npm You should probably upgrade to a newer version of node as we
2020-03-25T16:50:32.126812+00:00 app[web.1]: npm WARN npm can't make any promises that npm will work with this version.
2020-03-25T16:50:32.127129+00:00 app[web.1]: npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
2020-03-25T16:50:32.127378+00:00 app[web.1]: npm WARN npm You can find the latest version at https://nodejs.org/
2020-03-25T16:50:32.263784+00:00 app[web.1]:
2020-03-25T16:50:32.263791+00:00 app[web.1]: > [email protected] start /app
2020-03-25T16:50:32.263792+00:00 app[web.1]: > react-scripts start
2020-03-25T16:50:32.263792+00:00 app[web.1]:
2020-03-25T16:50:34.783181+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.18.253.226/
2020-03-25T16:50:34.783787+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-03-25T16:50:34.783888+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-03-25T16:50:34.783977+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-03-25T16:50:34.784185+00:00 app[web.1]: Starting the development server...
2020-03-25T16:50:34.784187+00:00 app[web.1]:
2020-03-25T16:50:34.903396+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-25T16:50:34.886104+00:00 heroku[web.1]: Process exited with status 0
2020-03-25T20:32:58.790170+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=hidden-stream-53835.herokuapp.com request_id=d958c692-68ad-4723-a7da-1b0fb261e74b fwd="73.60.116.154" dyno= connect= service= status=503 bytes= protocol=https
2020-03-25T20:32:59.217144+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=hidden-stream-53835.herokuapp.com request_id=1e9dbfb7-070b-485e-906b-a30a2e0dcc35 fwd="73.60.116.154" dyno= connect= service= status=503 bytes= protocol=https
index.html
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
Solution 1:[1]
Whatever IP addresses you are assigned one time are going to change frequently. Don't bind to them specifically.
Instead, bind to all available IP addresses, which is typically represented by 0.0.0.0
or by not providing an IP address at all. Make sure to also use the port that Heroku specifies via the PORT
environment variable.
Assuming you're using Express, something like this should work:
const express = require('express')
const PORT = process.env.PORT || 5000 # Fall back to port 5000 if process.env.PORT is not set
express()
.listen(PORT, () => console.log(`Listening on ${ PORT }`))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Chris |