首页 > 解决方案 > 将 JS 应用程序部署到 Heroku - 错误 H10 503 错误,应用程序崩溃

问题描述

我的应用程序 - https://github.com/amyequinn/weatherApp在终端上完美运行 npm start 但是在将应用程序部署到 Heroku 时它崩溃了,我找不到解决方案。错误是 H10,App Crashed at Get 方法,状态 503...

"2020-05-08T23:13:34.132652+00:00 heroku[路由器]: at=error code=H10 desc="App crashed" method=GET path="/" host=weather-app-using-api.herokuapp .com request_id=edd028a6-ce4c-4b5f-b3c0-229af9eb24fb fwd="80.189.121.112" dyno= connect= service= status=503 bytes= protocol=https

2020-05-08T23:13:34.964932+00:00 heroku[路由器]: at=error code=H10 desc="App crashed" method=GET path="/" host=weather-app-using-api.herokuapp. com request_id=63ded901-6716-4f7a-8f8a-fe0409a9349d fwd="80.189.121.112" dyno= connect= service= status=503 bytes= protocol=https

2020-05-08T23:13:36.414179+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=weather-app-using-api .herokuapp.com request_id=60c048dd-edbd-405d-aee7-740983dbddf fwd="80.189.121.112" dyno= connect= service= status=503bytes= protocol=https"

有任何想法吗??

非常感谢您的帮助!谢谢 :)

标签: javascriptherokudeploying

解决方案


我按照这个建议让它工作了 - https://codeburst.io/deploy-your-webpack-apps-to-heroku-in-3-simple-steps-4ae072af93a8

创建 server.js 文件并包含上面链接的内容,确保我的文件路径正确。

在终端中运行“webpack -p”和“npm run dev”或“node server.js”

它已在https://weather-app-using-api.herokuapp.com/上成功发布到 Heroku


推荐阅读