在gh页上部署React应用,但页面返回404

时间:2018-10-22 07:43:53

标签: javascript reactjs github-pages

[更新]正如许多人所怀疑的那样,此错误是由于昨天(18.10.21)的github事件引起的,现在已修复,因此我的页面再次出现。谢谢大家

我最近在gh-pages上发布了我的第一个React App。所有文件都显示在存储库中,在localhost上我也没有遇到任何问题,加上终端在部署时也没有问题。

我相信我在Package.json中的设置正确,请参见下文。有人可以帮我解决这个问题吗?

这是仓库,以防万一 https://github.com/cyg65/profile

{
"name": "portfolio",
"version": "0.1.2",
"private": true,
"homepage": "https://cyg65.github.io/profile",
"dependencies": {
"bootstrap": "^4.1.3",
"gh-pages": "^2.0.1",
"jquery": "^3.3.1",
"popper.js": "^1.14.4",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-icons": "^3.2.1",
"react-router-dom": "^4.3.1",
"react-scripts": "2.0.5"
},
"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"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"eslint-config-prettier": "^3.1.0",
"eslint-plugin-prettier": "^3.0.0",
"flow-bin": "^0.83.0",
"prettier": "^1.14.3"
}
}

0 个答案:

没有答案