【发布时间】:2020-11-13 22:59:42
【问题描述】:
我是 react 和 nextjs 的新手。我设法在 nextjs 中开发了一个简单的网站,当我使用 npm run build 在本地系统中构建项目时它正常工作,然后我尝试在仪表板中的 heroku 中部署它显示构建成功并部署但是当我检查项目时使用给定的链接显示应用程序错误。在我检查 heroku 日志后,它的节目 Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 就像这样。通过检查有关此链接的一些线程,我设法重新启动了heroku,但仍然没有使用同样的问题。我还通过更改 package.json 将端口从 3000 更改为 5000。如果有人指出这个问题,那将非常有帮助。
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start -p 5000"
},
这是我的heroku日志
2020-07-24T05:14:15.020173+00:00 heroku[web.1]: Starting process with command `npm start`
2020-07-24T05:14:17.215400+00:00 app[web.1]:
2020-07-24T05:14:17.215416+00:00 app[web.1]: > abcapp@0.1.0 start /app
2020-07-24T05:14:17.215416+00:00 app[web.1]: > next start
2020-07-24T05:14:17.215416+00:00 app[web.1]:
2020-07-24T05:14:17.458010+00:00 app[web.1]: ready - started server on http://localhost:3000
2020-07-24T05:14:37.208072+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=abcapp.herokuapp.com request_id=55de2c51-58d2-430d-883d-7a1bc05cecfc fwd="157.46.187.156" dyno= connect= service= status=503 bytes= protocol=https
2020-07-24T05:15:15.482693+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-07-24T05:15:15.502706+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-07-24T05:15:15.584970+00:00 heroku[web.1]: Process exited with status 137
2020-07-24T05:15:15.629010+00:00 heroku[web.1]: State changed from starting to crashed
2020-07-24T05:15:17.145562+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=abcapp.herokuapp.com request_id=9e610deb-8e1e-4ca6-9e60-7516bc36cd92 fwd="157.46.187.156" dyno= connect= service= status=503 bytes= protocol=https
【问题讨论】: