Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 应用程序错误:在Heroku上部署react js项目_Reactjs_Heroku_Web Deployment - Fatal编程技术网

Reactjs 应用程序错误:在Heroku上部署react js项目

Reactjs 应用程序错误:在Heroku上部署react js项目,reactjs,heroku,web-deployment,Reactjs,Heroku,Web Deployment,我遵循的教程从。一切正常,我已经通过添加名为engines的新对象配置了我的package.json,但是当我打开应用程序时,它会显示应用程序错误,我运行这个命令heroku logs--tail,它会在下面显示错误 2020-11-06T10:18:19.369209+00:00 heroku[web.1]: State changed from starting to crashed 2020-11-06T10:20:14.005978+00:00 heroku[router]: at=er

我遵循的教程从。一切正常,我已经通过添加名为
engines
的新对象配置了我的package.json,但是当我打开应用程序时,它会显示应用程序错误,我运行这个命令
heroku logs--tail
,它会在下面显示错误

2020-11-06T10:18:19.369209+00:00 heroku[web.1]: State changed from starting to crashed
2020-11-06T10:20:14.005978+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=immense-beyond-93095.herokuapp.com request_id=6563476d-6eb0-47ad-8c85-39d457e22a20 fwd="110.54.238.117" dyno= connect= service= status=503 bytes= protocol=https
=immense-beyond-93095.herokuapp.com request_id=6597bf5d-2d7f-477f-a893-aef0cb946619 fwd="110.54.238.117" dyno= connect= s=immense-beyond-93095.herokuapp.com reqervice= status=503 bytes= protocol=https 
这是我的package.json

{
  "name": "uncle-edge-website",
  "version": "1.0.0",
  "description": "Uncle Edge Unli Wings",
  "private": true,
  "main": "src/index.js",
  "engines": {
    "npm": "6.14.4",
    "node": "12.16.2"
  },
  "dependencies": {
    "@material-ui/core": "4.10.0",
    "@material-ui/icons": "4.9.1",
    "classnames": "2.2.6",
    "history": "4.10.1",
    "moment": "2.26.0",
    "node-sass": "4.14.1",
    "nouislider": "14.5.0",
    "prop-types": "15.7.2",
    "react": "16.13.1",
    "react-datetime": "2.16.3",
    "react-dom": "16.13.1",
    "react-router-dom": "5.2.0",
    "react-scripts": "3.4.1",
    "react-slick": "0.26.1",
    "react-swipeable-views": "0.13.9"
  },
  "devDependencies": {
    "@babel/cli": "7.10.1",
    "@babel/plugin-proposal-class-properties": "7.10.1",
    "@babel/preset-env": "7.10.1",
    "@babel/preset-react": "7.10.1",
    "eslint-config-prettier": "6.11.0",
    "eslint-plugin-prettier": "3.1.3",
    "eslint-plugin-react": "7.20.0",
    "gulp": "4.0.2",
    "gulp-append-prepend": "1.0.8",
    "prettier": "2.0.5"
  },
  "optionalDependencies": {
    "typescript": "3.9.3"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build && gulp licenses",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
    "lint:check": "eslint . --ext=js,jsx;  exit 0",
    "lint:fix": "eslint . --ext=js,jsx --fix;  exit 0",
    "install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
    "build-package-css": "node-sass src/assets/scss/material-kit-react.scss dist/material-kit-react.css",
    "build-package": "npm run build-package-css && babel src --out-dir dist",
    "compile-sass": "node-sass src/assets/scss/material-kit-react.scss src/assets/css/material-kit-react.css",
    "minify-sass": "node-sass src/assets/scss/material-kit-react.scss src/assets/css/material-kit-react.min.css --output-style compressed",
    "map-sass": "node-sass src/assets/scss/material-kit-react.scss src/assets/css/material-kit-react.css --source-map true"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": []
  }
}


这是网站
https://immense-beyond-93095.herokuapp.com/

是否添加了react构建包?你的文章描述中没有,但是评论中提到了。我通过添加react buildpack修复了这个问题。谢谢