【发布时间】:2021-12-22 16:12:06
【问题描述】:
我正在按照https://github.com/gitname/react-gh-pages 的说明将我的 React 应用部署到 github 页面。
在链接中,我得到一个空白页和一个 404 错误:
Failed to load resource: the server responded with a status of 404 ()
我的应用在本地主机上运行
我四处搜索,可能我的主页链接有误?
链接到我的仓库:https://github.com/PatgioK/pathfindingvisualizer
应用链接:https://patgiok.github.io/pathfindingvisualizer/
这是我的 package.json:
{
"name": "pathfindingvisualizer",
"version": "0.1.0",
"private": true,
"homepage": "https://patgiok.github.io/pathfindingvisualizer/",
"dependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"gh-pages": "^3.2.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"save-dev": "0.0.1-security",
"web-vitals": "^1.1.2"
},
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -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"
]
}
}
【问题讨论】:
标签: javascript reactjs github