heroku上Gatsby应用程序部署存在问题



我在Heroku上部署Portfolio时遇到问题。我读了很多关于Stack Overflow的文章、教程和答案,但它仍然不能解决我的问题。

这是我的package.json:

{
"name": "my-website",
"version": "1.0.0",
"private": true,
"description": "Daniel Rolewski's personal website.",
"author": "DanielRolewski",
"keywords": [
"gatsby"
],
"engines": {
"node": "14.15.1",
"npm": "6.14.8"
},
"buildpacks": [
{
"url": "heroku/nodejs"
},
{
"url": "https://github.com/heroku/heroku-buildpack-static"
}
],
"scripts": {
"build": "gatsby build",
"start": "gatsby develop -p 5000"
},
"dependencies": {
"classnames": "^2.2.6",
"gatsby": "^2.30.2",
"gatsby-image": "^2.9.0",
"gatsby-plugin-alias-imports": "^1.0.5",
"gatsby-plugin-react-helmet": "^3.7.0",
"gatsby-plugin-sass": "^2.8.0",
"gatsby-plugin-sharp": "^2.12.1",
"gatsby-source-filesystem": "^2.9.0",
"gatsby-transformer-sharp": "^2.10.1",
"gsap": "^3.6.0",
"node-sass": "^4.14.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-helmet": "^6.1.0",
"typewriter-effect": "^2.17.0"
}
}

和我的heroku logs:

2021-07-14T14:49:02.111197+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2021-07-14T14:49:02.196230+00:00 heroku[web.1]: Stopping process with SIGKILL
2021-07-14T14:49:02.358675+00:00 heroku[web.1]: Process exited with status 137
2021-07-14T14:49:02.572895+00:00 heroku[web.1]: State changed from starting to crashed
2021-07-14T14:49:03.913083+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=danielrolewski-portfolio.herokuapp.com request_id=d82d115e-6694-423a-b781-fa5f17ea994c fwd="176.221.123.233" dyno= connect= service= status=503 bytes= protocol=https
2021-07-14T14:49:04.759144+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=danielrolewski-portfolio.herokuapp.com request_id=20d739d5-b2e3-45ee-ac19-24fe81a39c1c fwd="176.221.123.233" dyno= connect= service= status=503 bytes= protocol=http
2021-07-14T14:49:04.925571+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=danielrolewski-portfolio.herokuapp.com request_id=6e13f76f-b6ae-4d58-a988-d28283eec6c5 fwd="176.221.123.233" dyno= connect= service= status=503 bytes= protocol=http

更改后:"start": "gatsby develop -p 5000"收件人:"start": "gatsby serve"

我有:

2021-07-14T15:15:27.903302+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2021-07-14T15:15:27.952418+00:00 heroku[web.1]: Stopping process with SIGKILL
2021-07-14T15:15:28.080741+00:00 heroku[web.1]: Process exited with status 137
2021-07-14T15:15:28.172552+00:00 heroku[web.1]: State changed from starting to crashed
2021-07-14T15:15:29.648616+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=danielrolewski-portfolio.herokuapp.com request_id=5a31bb31-bcda-4048-9f21-05654e6cba75 fwd="176.221.123.233" dyno= connect= service= status=503 bytes= protocol=http
2021-07-14T15:15:29.748779+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=danielrolewski-portfolio.herokuapp.com request_id=ab0ee939-a3c1-4895-aac6-5df07f8df0ab fwd="176.221.123.233" dyno= connect= service= status=503 bytes= protocol=https
2021-07-14T15:15:29.807695+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=danielrolewski-portfolio.herokuapp.com request_id=c4c82eb5-2782-42c7-8edc-d2d5d65aab84 fwd="176.221.123.233" dyno= connect= service= status=503 bytes= protocol=http

我尝试了很多方法,但都不起作用。有什么想法吗?

我已经解决了!我真的什么都没改变,在30次同样的部署后,它工作得很好。

最新更新