Heroku shows code=H10 desc="App crashed" for a Node.js app
at=error code=H10 desc="App crashed" method=GET path="/"Short answer
H10 means the web dyno crashed or did not boot in time. The router log line only reports it; the reason is in the lines above it. Run heroku logs --tail, read the first error after the app started, and then fix a crash in your code, a port you never bind, or a wrong Procfile command.
Fix it fast
1Find out which cause you have
Stream the logs and restart the dyno, so the crash happens while you watch. The first error from app[web.1] is the real cause.
heroku restart heroku logs --tail2Match what you see, then jump to its fix
- 1
A stack trace from app[web.1] right before heroku[web.1]: Process exitedThe app throws an error while startingFix - 2
Error R10 (Boot timeout) in the logs, then the dyno is killed and H10 followsThe web process does not bind to the assigned port in 60 secondsFix - 3
Starting process with command ... followed by Cannot find module or an immediate exitThe Procfile or start command runs the wrong fileFix
- 1
What does the error look like?
at=error code=H10 desc="App crashed" method=GET path="/"heroku[web.1]: Process exited
Cause 1 of 3
The app throws an error while starting
1Check
The Heroku error page shows an H10 example where the log line before the crash names a missing dependency. Read the lines just above the exit for a missing module, a missing config value or a failed connection.
heroku logs --num 100
heroku config2Fix
Fix what the stack trace names. A module that is missing in production must be in dependencies, and secrets must be set as config vars.
npm install some-package --save
heroku config:set DATABASE_URL="your-value"3Verify
The dyno shows up after a restart.
heroku psConfirmed by devcenter.heroku.com
Cause 2 of 3
The web process does not bind to the assigned port in 60 seconds
1Check
A web process that takes more than 60 seconds to bind to its assigned $PORT is killed and counts as crashed, and the boot timeout shows as H10. Check whether the code listens on a fixed number instead of the port Heroku passes.
grep -rn "listen(" --include=*.js .2Fix
Listen on the port from the environment. If startup is slow, load external resources without blocking the listen call.
const port = process.env.PORT || 5006;
app.listen(port, () => console.log(`Listening on ${port}`));3Verify
The log shows the app listening and the dyno state is up.
heroku logs --tail
heroku psConfirmed by devcenter.heroku.com
Cause 3 of 3
The Procfile or start command runs the wrong file
1Check
The Procfile declares the command for the web process, and the log line Starting process with command shows what Heroku ran. If it names a file that is not in the repo root, the dyno exits.
cat Procfile
heroku logs --tail2Fix
Declare the web process with the right entry file, then commit and deploy.
# Procfile
web: node index.js3Verify
heroku ps lists web.1 as up after the next deploy.
git add Procfile && git commit -m "Fix Procfile"
git push heroku main
heroku psConfirmed by devcenter.heroku.com
How do I stop it coming back?
- Always read the port from process.env.PORT.
- Keep every runtime package in dependencies, not devDependencies.
- Run the app locally with the same start command as the Procfile before deploying.
- Set config vars with heroku config:set before the first deploy that needs them.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Back end
Heroku kills a Node.js app that does not bind to $PORT in time
Stopping process with SIGKILL
Heroku gives a web process 60 seconds to listen on the port it assigns in $PORT, then kills it with R10.
3 causes, each with a fixBack end
ng serve says it cannot determine the project or target
Cannot determine project for command.
The Angular CLI looked through angular.json for a project that defines the target you asked for (serve, build, test) and found none, or found several and could not pick one.
3 causes, each with a fixBack end
ng fails with Cannot find module @angular/cli/bin/ng
Cannot find module '@angular/cli/bin/ng'
The ng command is the entry point to the Angular CLI package.
2 causes, each with a fixBack end
Angular app shows 'Cannot GET /' when served by a Node.js server
Cannot GET /dashboard
Cannot GET / is Express saying no route or file matches the request.
3 causes, each with a fixBack end
ng serve cannot find the dev-server builder package
Could not find the implementation for builder @angular/build:dev-server
The builder named in angular.json (for example @angular-devkit/build-angular:dev-server) is looked up as an npm package starting from the workspace root.
3 causes, each with a fixBack end
Angular build says it cannot resolve '@angular/localize/init'
Can't resolve '@angular/localize/init' in '/usr/src/app/src'
The build imports @angular/localize, and that package is not in node_modules.
2 causes, each with a fix