当我尝试将React App部署到GitHub页面时遇到问题,它显示一个空白页面,空白。 在我的GitHub中,我看到了一些文件,但没有看到源文件本身。 我用纱布展开。 这是package.json文件:
"name": "monsters-relodex",
"homepage": "https://eliranma.github.io/monster-rolodex",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"gh-pages": "^3.1.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "yarn build",
"deploy": "gh-pages -b master -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"
]
}
}
答案 0 :(得分:0)
尝试更改
此"deploy": "gh-pages -b master -d build"
到"deploy": "gh-pages -d build"
如果问题仍然存在,我认为问题是您的master分支上没有实际的源代码。在master分支上提交代码(src文件夹)本身,然后重试。