So I've been trying to deploy my app with Heroku, and it runs locally perfectly fine, but I keep running into the same H10 error below:
2022-09-15T02:57:14.484472+00:00 heroku[web.1]: Starting process with command `npm start`
2022-09-15T02:57:17.725863+00:00 app[web.1]:
2022-09-15T02:57:17.725906+00:00 app[web.1]: > node-sso-example-app@1.0.0 start
2022-09-15T02:57:17.725912+00:00 app[web.1]: > nodemon index.js
2022-09-15T02:57:17.725915+00:00 app[web.1]:
2022-09-15T02:57:17.731558+00:00 app[web.1]: /tmp/start-d846bb8e.sh: 1: nodemon: not found
2022-09-15T02:57:17.847830+00:00 heroku[web.1]: Process exited with status 127
2022-09-15T02:57:17.916430+00:00 heroku[web.1]: State changed from starting to crashed
2022-09-15T02:57:19.230286+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=will-dersh.herokuapp.com request_id=9e07b48e-dcd7-42eb-b6bc-d9d7e138b15a fwd="108.67.29.121" dyno= connect= service= status=503 bytes= protocol=https
2022-09-15T02:57:19.499659+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=will-dersh.herokuapp.com request_id=f7501cb9-60c7-457d-97ed-63cffdfe872f fwd="108.67.29.121" dyno= connect= service= status=503 bytes= protocol=https
Here's my index.js file:
import express from 'express'
import 'dotenv/config'
import router from './routes/index.js'
import morgan from 'morgan'
const app = express()
app.use('/public', express.static('public'))
app.use(express.urlencoded({ extended: false }))
app.use(express.json())
app.use(morgan('dev'))
app.use('/', router)
app.listen(process.env.PORT || 8000, function(){
console.log("Express server listening on port %d in %s mode", this.address().port, app.settings.env);
});
Here's the package.json:
{
"name": "node-sso-example-app",
"version": "1.0.0",
"description": "Example Node.js SSO App using WorkOS",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon index.js"
},
"author": "WorkOS",
"dependencies": {
"@workos-inc/node": "^2.11.0",
"cookie-parser": "^1.4.6",
"dotenv": "^16.0.1",
"ejs": "^3.1.8",
"express": "^4.18.1",
"express-session": "^1.17.2",
"http-errors": "~1.6.3",
"morgan": "^1.10.0",
"router": "^1.3.7"
},
"devDependencies": {
"nodemon": "^2.0.19"
}
}
And if it helps, here is my Procfile:
web:node index.js
I'm not really sure where I've gone wrong so any help would be appreciated!