Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

741
Views
Deploying on Heroku: Heroku gives me error 503 when app is deployed but app works on localhost

I'm trying to deploy a mern project for uni (already deplyoed react app on firebase) but my express/node.js rest api only works on localhost. I don't think the app even starts when deployed. Heroku gives me these errors:

Application error An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command

and error 503 service unavailable in the network tab.


I tried heroku logs --tail and it said heroku[router]: at=error code=H10 desc="App crashed" method=GET ...


my Procfile:

web: node index.js

my package.json:

{
  "name": "server",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node index.js"
  },
  "keywords": [
    "heroku"
  ],
  "engines": {
    "node": "16.x"
  },
  "author": "me",
  "license": "ISC",
  "dependencies": {
    "bcrypt": "^5.0.1",
    "express": "^4.17.1",
    "jsonwebtoken": "^8.5.1",
    "mongoose": "^6.0.14"
  }
}

PORT variable in index.js:

const PORT = process.env.PORT || 5000;
...
app.listen(PORT, () => console.log(`Server listening on port ${PORT}`));

I used Heroku CLI to deploy the app:

git init
git add .
git commit -am "initial commit"
heroku git:remote -a {project-name}
git push heroku master
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!