I'm trying to deploy my first React application on Heroku. The Build portion appears successful, but launching the app delivers a white screen with "Application error."
I've followed heroku logs --tail, but cannot identify the errors that it is giving me.
Heroku logs --tail:
2019-05-30T13:15:28.528598+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/" host=serene-peak-
12902.herokuapp.com request_id=e2d2bd7d-9b96-42fb-a4ce-89cc7bccfad6
fwd="67.166.97.166" dyno= connect= service= status=503 bytes=
protocol=https
2019-05-30T13:15:29.101530+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/favicon.ico" host=serene-peak-
12902.herokuapp.com request_id=44fa674d-ef39-4132-9c6f-430038be66ec
fwd="67.166.97.166" dyno= connect= service= status=503 bytes=
protocol=https
Heroku run node console:
internal/modules/cjs/loader.js:550
throw err;
^
Error: Cannot find module '/app/console'
at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:548:15)
at Function.Module._load (internal/modules/cjs/loader.js:475:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
(Assuming you're using stack MERN) Heroku can't find the root path. You have to get your Express app to serve your React app, so you need to config your server.js file in order to do that.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.