Maaz Zindani

Loading the index…

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

Heroku shows Application error and H10 after deploying an Express app

Errorat=error code=H10 desc="App crashed" method=GET path="/"

Short answer

H10 means the web dyno crashed or never started. The log lines just before it name the reason. For a first Node.js deploy it is nearly always a missing web command (no Procfile and no start script), a misnamed Procfile, or an error thrown while booting the app.

  • Applies to Heroku Node.js buildpack, Node.js 22, Node.js 24, Express 5
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Stream the logs and reload the page. Read the lines from the dyno, not just the router line with H10.

    heroku logs --tail
  2. 2Match what you see, then jump to its fix

    1. 1The dyno starts and exits straight away, and no Procfile or start script existsNo web process is definedFix
    2. 2You wrote a Procfile, but the dyno still does not start the command in itThe Procfile has the wrong name or is in the wrong folderFix
    3. 3A stack trace in the app[web.1] lines, then Process exited and crashedThe app throws an error while startingFix
    4. 4Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launchThe web process does not bind to the port Heroku assigns in timeFix

What does the error look like?

  • at=error code=H10 desc="App crashed" method=GET path="/"
  • State changed from starting to crashed
  • status=503

Cause 1 of 4

No web process is defined

1Check

Heroku uses the Procfile first. With no Procfile, it falls back to the start script in package.json. With neither, nothing serves traffic.

ls Procfile
grep -n "\"start\"" package.json

2Fix

Add a start script, or a Procfile with a web line, and deploy again.

# package.json
"scripts": { "start": "node server.js" }

# or Procfile
web: node server.js

3Verify

Deploy and check that the dyno is up.

git push heroku main
heroku ps

Confirmed by devcenter.heroku.com

Did this fix it?

Cause 2 of 4

The Procfile has the wrong name or is in the wrong folder

1Check

The file must be named Procfile with no extension, and it must sit in the app's root directory.

git ls-files | grep -i procfile

2Fix

Rename it and move it to the repository root, then commit.

git mv Procfile.txt Procfile
git commit -m "Fix Procfile name"

3Verify

Push and read the first lines of the dyno log.

git push heroku main
heroku logs --tail

Confirmed by devcenter.heroku.com

Did this fix it?

Cause 3 of 4

The app throws an error while starting

1Check

The H10 page shows exactly this pattern: an error from the app, then the process exits. Common sources are a missing package, a bad config value, or code that needs a config var that is not set.

heroku logs --num 200
heroku config

2Fix

Fix what the stack trace names, set missing config vars, and deploy again.

heroku config:set DATABASE_URL="postgres://example"

3Verify

The dyno shows as up and the page loads.

heroku ps
heroku open

Confirmed by devcenter.heroku.com

Did this fix it?

Cause 4 of 4

The web process does not bind to the port Heroku assigns in time

1Check

A boot timeout also shows H10. The web process has 60 seconds to bind to the port Heroku gives it.

grep -rn "listen(" server.js

2Fix

Listen on the port from the environment.

const port = process.env.PORT || 3000;
app.listen(port);

3Verify

Redeploy; the R10 line should not appear.

heroku logs --tail

Confirmed by devcenter.heroku.com

Did this fix it?

How do I stop it coming back?

  • Define the web command in a start script or a Procfile before the first deploy.
  • Run npm start locally with NODE_ENV=production to see crashes before pushing.
  • Set every required config var with heroku config:set before the release.
  • Pin the Node.js version in package.json engines to a supported release line.

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

Next step

Want this handled for good?

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