我正在部署我的静态React应用程序(完全是前端,没有API,没有node.js,没有express-只是前端)。它在本地运行良好,我能够成功地将其构建到Heroku。当我在Windows操作系统上通过git bash运行heroku open时,浏览器窗口随即打开,其中包含我的heroku网站,但该网站上显示应用程序错误。我运行heroku日志--tail有时会出现H13错误,但始终会出现H10错误。我粘贴了以下错误。 我已在包json中的引擎中包含了npm和node的版本,并且查看了Heroku错误代码(https://devcenter.heroku.com/articles/error-codes#h13-connection-closed-without-response),但没有任何解决方案。我还搜索了整个stackoverflow,但没有找到任何对我有帮助的解决方案。错误代码在下面,我用星号代替了我认为敏感和无关的信息。我对stackoverflow不太熟悉,我们将不胜感激!
heroku [路由器]:at =错误代码= H13 desc =“连接已关闭,无响应” method = GET path =“ /” host = ****。herokuapp.com request_id = **** fwd =“ ****” dyno = web.1 connect = 1ms服务= 19004ms状态= 503字节= 0协议= https 2020-02-29T19:42:51.522926 + 00:00 heroku [web.1]:状态从更改为崩溃 2020-02-29T19:42:51.503699 + 00:00 heroku [web.1]:进程退出,状态为1 2020-02-29T19:42:52.101343 + 00:00 heroku [router]:at =错误代码= H10 desc =“应用程序崩溃”,方法= GET path =“ / favicon.ico” host = ****。herokuapp。 com request_id = **** fwd =“ ****” dyno = connect = service = status = 503 bytes = protocol = https
package json
{
"name": "nhreact",
"version": "0.1.0",
"private": true,
"engines": {
"npm": "6.12.0",
"node": "12.13.0"
},
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.3",
"@testing-library/user-event": "^7.1.2",
"jquery": "^3.4.1",
"node-sass": "^4.13.1",
"radium": "^0.26.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.3.0",
"three": "^0.113.2",
"vanta": "^0.5.10"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}