javascript - React 应用程序在部署到 github 页面后显示空白页面
问题描述
我正在尝试将我的投资组合网站部署到 github 页面,但部署后它显示一个空白页面
您可以在以下位置找到存储库:here
我已经尝试将基本名称添加到 BrowserRouter 和其他东西,但它仍然不起作用。
下面是 package.json 提取:
{
"homepage": "https://oneknucklehead.github.io/oneknucklehead.github.io/",
"name": "portfolio",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-icons": "^4.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-scroll": "^1.8.2",
"react-use": "^17.2.4",
"styled-components": "^5.3.0",
"typewriter-effect": "^2.18.0",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
解决方案
推荐阅读
- android - 创建 buildSrc 和 build.gradle.kts 时出现此错误的新 Android Studio 4.2 Preview
- deep-learning - 不是图像到图像转换的任务如何与 Pix2pix 一起工作?
- talend - Fiddler 未捕获 Talend tRestClient 调用
- python - 异常后需要按键两次 - Python tkinter
- python - Panda Dataframe to.string with a decimal point (,)
- reactjs - 状态未在反应挂钩中更新
- python - 在 Python 中溶解线条
- c++ - C++/WinRT UWP:创建自定义 DataTemplateSelector
- excel - 列中的 VBA SUM 动态范围
- r - 组合居中图例