简体   繁体   English

在 Github 上部署我的 React 应用程序后,我收到 404 错误页面(请帮忙)

[英]I am getting a 404 error page after deploying my react app on Github (help please)

So I followed the steps on installing gh-pages and deploying my project onto github. However, my github page is giving me a 404 error and gave me this message: "If this is your site, make sure that the filename case matches the URL. For root URLs (like http://example.com/ ) you must provide an index.html file".所以我按照安装 gh-pages 并将我的项目部署到 github 上的步骤进行操作。但是,我的 github 页面给我一个 404 错误并给了我这条消息:“如果这是你的网站,请确保文件名大小写与 URL 匹配. 对于根 URL(如http://example.com/ ),您必须提供一个 index.html 文件”。 I have been googling around and nothing comes up.我一直在谷歌搜索,但什么也没有出现。 I even switch the branch to gh-pages, but the page comes out blank.我什至将分支切换到 gh-pages,但页面是空白的。

Here is my package.json file:这是我的 package.json 文件:

  {
  "name": "dessert-menu",
  "version": "0.1.0",
  "homepage": "https://aaronv-github.github.io/DessertMenu/",
  "private": true,
  "dependencies": {
    "-": "^0.0.1",
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.1.1",
    "@testing-library/user-event": "^13.5.0",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "react-scripts": "^5.0.1",
    "save": "^2.5.0",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "predeploy": "npm run build",
    "deploy": "gh-pages -b master -d build",
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "gh-pages": "^4.0.0",
    "react-router-dom": "^6.3.0"
  }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 vercel 上部署我的 nextjs 应用程序时出现此错误 - I am getting this error while deploying my nextjs app on vercel 我正在尝试通过 express 为我的 React 应用程序提供服务,为什么我会收到 404? - I'm trying to serve my react app from express, why am I getting a 404? 为什么我的 Javascript 收到 404 错误消息? - Why am I getting a 404 error message in my Javascript? 为什么我在与节点反应时对此得到404 - Why am I getting a 404 on this in react with node 在 Netlify 上部署 React 应用程序返回 404 页面未找到 - Deploying React app on Netlify returns 404 page not found 列表中的每个孩子都应该有一个唯一的“关键”道具,我在我的反应原生应用程序中遇到了这个错误 - Each child in a list should have a unique "key" prop, I am getting this error in my react native app 我在反应页面刷新后从 firebase 获取数据 - I am getting data from firebase after page refresh in react 我正在尝试在我的 react redux 应用程序中使用 map。 但使用useDispatch后,控制台显示错误 - I am trying to use map in my react redux app. but after using useDispatch, the console is showing error 我没有在我的 React-app 中获得列表项 - I am not getting the list item in my React-app 在 github 页面上部署反应应用程序时出现错误:“react-dom.production.min.js:216 TypeError: Object(...) is not a function” - Getting error : "react-dom.production.min.js:216 TypeError: Object(...) is not a function" while deploying react app on github pages
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM