1
votes

I'm trying to deploy my app to heroku. It pushes without issue but when i got to open the app it says.

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

My logs give me the following error

2020-06-17T22:33:21.630742+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vast-dawn-11704.herokuapp.com request_id=23bad058-65f3-4ee2-bfdb-be4d560fb0f6 fwd="27.4.196.168" dyno= connect= service= status=503 bytes= protocol=https 2020-06-17T22:33:23.760317+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=vast-dawn-11704.herokuapp.com request_id=56da289d-a7b5-44b0-b53e-059b3eb260e8 fwd="27.4.196.168" dyno= connect= service= status=503 bytes= protocol=https 2020-06-17T22:33:27.668207+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vast-dawn-11704.herokuapp.com request_id=7042d1ab-8d02-418e-8648-57f24b749dd0 fwd="27.4.196.168" dyno= connect= service= status=503 bytes= protocol=https 2020-06-17T22:33:28.338705+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=vast-dawn-11704.herokuapp.com request_id=d585ff4f-42ee-434d-8943-8b8a7474f9dd fwd="27.4.196.168" dyno= connect= service= status=503 bytes= protocol=https 2020-06-17T22:36:03.372884+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vast-dawn-11704.herokuapp.com request_id=21d34f62-f174-4b49-a08f-6fda33e64c31 fwd="27.4.196.168" dyno= connect= service= status=503 bytes= protocol=https 2020-06-17T22:36:04.037609+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=vast-dawn-11704.herokuapp.com request_id=5b1e452a-a254-42c1-8988-6f831da8458e fwd="27.4.196.168" dyno= connect= service= status=503 bytes= protocol=https

My server.js code looks like this

const express = require('express')
const cors = require('cors')
const connectDb = require('./config/db')

const app = express()

// Connect to database
connectDb()

// Initilize middleware
app.use(cors())
app.use(express.json())

// Define routes
app.use('/api/models', require('./routes/api/model'))
app.use('/api/modelParameters', require('./routes/api/modelParameters'))
app.use('/api/containers', require('./routes/api/container'))

const PORT = process.env.PORT || 5000

app.listen(PORT, console.log(`Listening on port ${PORT}`))
1
Are you hosting both frontend and backend on heroku? If yes, your react code is inside of public/ or client/?Lucas L.
Same question with @lucasmrl and you need to serve everything over https not http. Did you implement it?halilcakar
hey my react is in a client folder and and server.js on the root folder.Ziyak
Hello, I am presenting this problem, I would like to know if you can see my question where I specify everything, please stackoverflow.com/questions/62626009/…arthuro ali

1 Answers

0
votes

You can check problem cause (error code H10) and the solutions which is listed here. Maybe one of those solutions would help you