Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Node.js, PHP and APIs

Heroku shows code=H10 desc="App crashed" for a Node.js app

Errorat=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.

  • Applies to Heroku Cedar, Heroku CLI, Node.js 22
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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 --tail
  2. 2Match what you see, then jump to its fix

    1. 1A stack trace from app[web.1] right before heroku[web.1]: Process exitedThe app throws an error while startingFix
    2. 2Error 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. 3Starting process with command ... followed by Cannot find module or an immediate exitThe Procfile or start command runs the wrong fileFix

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 config

2Fix

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 ps

Confirmed by devcenter.heroku.com

Did this fix it?

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 ps

Confirmed by devcenter.heroku.com

Did this fix it?

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 --tail

2Fix

Declare the web process with the right entry file, then commit and deploy.

# Procfile
web: node index.js

3Verify

heroku ps lists web.1 as up after the next deploy.

git add Procfile && git commit -m "Fix Procfile"
git push heroku main
heroku ps

Confirmed by devcenter.heroku.com

Did this fix it?

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

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 fix

Back 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 fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.