【问题标题】:Heroku Crash Error: heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico"Heroku 崩溃错误:heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico"
【发布时间】:2020-12-13 16:43:44
【问题描述】:

我正在尝试在 heroku 上启动我的 nodejs 应用程序。但是每次它启动它都会崩溃并出现以下错误。人们不断提到我必须进行一些端口修复,但我不明白在哪里以及如何进行?有人可以帮我调试这个崩溃问题吗?如果我在本地使用 npm start 运行它,它工作正常。

这是我的仓库:https://github.com/Gorgutzz/portfolio-site

2020-08-25T02:29:52.559666+00:00 heroku[web.1]: State changed from crashed to starting
2020-08-25T02:30:03.658131+00:00 heroku[web.1]: Starting process with command `npm start`
2020-08-25T02:30:06.506095+00:00 app[web.1]:
2020-08-25T02:30:06.506170+00:00 app[web.1]: > portfolio-site@0.1.0 start /app
2020-08-25T02:30:06.506176+00:00 app[web.1]: > react-scripts start
2020-08-25T02:30:06.506181+00:00 app[web.1]:
2020-08-25T02:30:09.243945+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.17.138.30/
2020-08-25T02:30:09.244281+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-08-25T02:30:09.244350+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-08-25T02:30:09.244420+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-08-25T02:30:09.244654+00:00 app[web.1]: Starting the development server...
2020-08-25T02:30:09.244655+00:00 app[web.1]:
2020-08-25T02:30:09.336466+00:00 heroku[web.1]: Process exited with status 0
2020-08-25T02:30:09.382429+00:00 heroku[web.1]: State changed from starting to crashed

2020-08-25T02:30:17.664264+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=leo-port123.herokuapp.com request_id=d96f2dd2-7ebf-4123-a30a-2a499c5e826f fwd="24.102.208.138" dyno= connect= service
= status=503 bytes= protocol=http
2020-08-25T02:30:18.664310+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=leo-port123.herokuapp.com request_id=f5a14315-78c3-41b9-b90c-ae748f7f4800 fwd="24.102.208.138" dyno= conne
ct= service= status=503 bytes= protocol=http

【问题讨论】:

    标签: node.js reactjs heroku


    【解决方案1】:

    Heroku 在每次 dyno 启动时随机分配的端口上运行。您有三个选择:

    【讨论】:

    • 我在哪个文件中手动设置端口?我似乎找不到任何关于在哪里做的提及。
    猜你喜欢
    • 1970-01-01
    • 2015-03-01
    • 2013-03-30
    • 1970-01-01
    • 2019-07-02
    • 1970-01-01
    • 1970-01-01
    • 2018-04-09
    • 1970-01-01
    相关资源
    最近更新 更多