无法在Heroku上部署React应用,这是我的package.json文件吗?

时间:2019-10-14 23:31:18

标签: reactjs heroku

我有一个非常基本的React应用程序,它在本地运行并运行-当我在终端中“ npm start”时,索引页面上会显示简单的消息。

部署到heroku之后,在heroku上打开项目时,终端上没有任何错误消息,但是在我的Heroku项目索引页面上得到此消息:“应用程序中发生错误,您的页面无法服务。”

我认为这与我的package.json有关:

{
  "name": "app",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "babel":{
    "presets" : [
      "@babel/preset-env",
      "@babel/preset-react"
    ]
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "webpack-dev-server --open"
  },
  "repository": {
    "type": "git",
    "url": "REMOVED-FOR-STACKOVERFLOW-Q"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@babel/core": "^7.6.2",
    "@babel/preset-env": "^7.6.2",
    "@babel/preset-react": "^7.0.0",
    "babel-loader": "^8.0.6",
    "css-loader": "^3.2.0",
    "html-webpack-plugin": "^3.2.0",
    "react": "^16.10.1",
    "react-dom": "^16.10.1",
    "style-loader": "^1.0.0",
    "webpack": "^4.41.0",
    "webpack-cli": "^3.3.9",
    "webpack-dev-server": "^3.8.1"
  }
}

0 个答案:

没有答案