[英]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.