为什么在 gh-pages 上部署的 React 应用程序在不同浏览器上显示空白页面,而在我的浏览器上正确显示?

IT技术 反应 还原 github页面
2021-05-10 16:32:38

我已按照 github pages 部署说明进行操作,并且已正确部署。但是当我在另一个浏览器上打开主页链接时,它显示的是空白页面。

下面提供了我的 package.json 文件

应用链接 https://abid413119.github.io/React-Redux-Todo-App/

{
  "name": "todo-app",
  "version": "0.1.0",
  "homepage": "https://abid413119.github.io/React-Redux-Todo-App",
  "private": true,
  "dependencies": {
    "@material-ui/core": "^4.3.2",
    "@material-ui/icons": "^4.2.1",
    "gh-pages": "^2.1.1",
    "material-ui": "^0.20.2",
    "react": "^16.9.0",
    "react-dom": "^16.9.0",
    "react-lottie": "^1.2.3",
    "react-redux": "^7.1.0",
    "react-scripts": "3.1.1",
    "redux": "^4.0.4",
    "redux-thunk": "^2.3.0",
    "uuid": "^3.3.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
  },
  "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"
    ]
  }
}

1个回答

它被设置为私人。公开!前往设置。在页面底部有危险区域部分。从那里使它成为公共!并再次部署您的应用程序!