将React.js部署到Heroku

时间:2020-08-03 22:48:09

标签: reactjs heroku

我正在尝试将我的react应用程序部署到heroku,但是遇到了问题。它始于开发环境,但是当我尝试将其部署到heroku时,它总是给我一个错误。我做了一个Heroku日志,就是这样。

YengVang@thaox734-3 my-app % heroku logs
 ›   Warning: heroku update available from 7.41.1 to 7.42.6.
2020-08-03T22:19:35.977467+00:00 app[api]: Release v1 created by user yenghuevang@hotmail.com
2020-08-03T22:19:35.977467+00:00 app[api]: Initial release by user yenghuevang@hotmail.com
2020-08-03T22:19:36.414417+00:00 app[api]: Enable Logplex by user yenghuevang@hotmail.com
2020-08-03T22:19:36.414417+00:00 app[api]: Release v2 created by user yenghuevang@hotmail.com
2020-08-03T22:29:01.000000+00:00 app[api]: Build started by user yenghuevang@hotmail.com
2020-08-03T22:30:31.109490+00:00 app[api]: Release v3 created by user yenghuevang@hotmail.com
2020-08-03T22:30:31.109490+00:00 app[api]: Deploy 0d91addc by user yenghuevang@hotmail.com
2020-08-03T22:30:31.122532+00:00 app[api]: Scaled to web@1:Free by user yenghuevang@hotmail.com
2020-08-03T22:30:39.000000+00:00 app[api]: Build succeeded
2020-08-03T22:30:45.080847+00:00 heroku[web.1]: Starting process with command `npm start`
2020-08-03T22:30:48.886430+00:00 app[web.1]: 
2020-08-03T22:30:48.886454+00:00 app[web.1]: > my-app@0.1.0 start /app
2020-08-03T22:30:48.886454+00:00 app[web.1]: > react-scripts start
2020-08-03T22:30:48.886455+00:00 app[web.1]: 
2020-08-03T22:30:54.665225+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.19.93.2/
2020-08-03T22:30:54.669685+00:00 app[web.1]: ℹ 「wds」: webpack output is served from /react-portfolio
2020-08-03T22:30:54.676548+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-08-03T22:30:54.683198+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /react-portfolio/
2020-08-03T22:30:54.685228+00:00 app[web.1]: Starting the development server...
2020-08-03T22:30:54.685231+00:00 app[web.1]: 
2020-08-03T22:30:54.872656+00:00 heroku[web.1]: Process exited with status 0
2020-08-03T22:30:54.913965+00:00 heroku[web.1]: State changed from starting to crashed
2020-08-03T22:30:54.916666+00:00 heroku[web.1]: State changed from crashed to starting
2020-08-03T22:31:03.914209+00:00 heroku[web.1]: Starting process with command `npm start`
2020-08-03T22:31:06.168416+00:00 app[web.1]: 
2020-08-03T22:31:06.168430+00:00 app[web.1]: > my-app@0.1.0 start /app
2020-08-03T22:31:06.168431+00:00 app[web.1]: > react-scripts start
2020-08-03T22:31:06.168431+00:00 app[web.1]: 
2020-08-03T22:31:08.332481+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.18.198.6/
2020-08-03T22:31:08.332801+00:00 app[web.1]: ℹ 「wds」: webpack output is served from /react-portfolio
2020-08-03T22:31:08.332875+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-08-03T22:31:08.332946+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /react-portfolio/
2020-08-03T22:31:08.333146+00:00 app[web.1]: Starting the development server...
2020-08-03T22:31:08.333147+00:00 app[web.1]: 
2020-08-03T22:31:08.423467+00:00 heroku[web.1]: Process exited with status 0
2020-08-03T22:31:08.460585+00:00 heroku[web.1]: State changed from starting to crashed
2020-08-03T22:31:10.510438+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shielded-lake-66282.herokuapp.com request_id=8772f806-430b-4402-bb5a-bd57f1a1fac1 fwd="24.7.201.199" dyno= connect= service= status=503 bytes= protocol=https
2020-08-03T22:31:11.018991+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shielded-lake-66282.herokuapp.com request_id=8f10366e-b90b-42b9-9929-d36199d516e7 fwd="24.7.201.199" dyno= connect= service= status=503 bytes= protocol=https

我尝试了很多不同的方法,但仍然无法弄清。

0 个答案:

没有答案