reactjs - 无法在 GitHub gh-pages 上部署反应应用程序
问题描述
我已经在 github 上部署了我的 react 应用程序,但它没有运行。 https://kinza98.github.io/Todo-List/ 谁能告诉我为什么我收到错误无法加载资源
解决方案
进行以下编辑package.json
并尝试再次部署它。
{
"name": "todo-react-basic",
"version": "0.1.0",
"private": true,
"homepage": "https://Kinza98.github.io/Todo-List",
"dependencies": {
"@loadable/component": "^5.14.1",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"gh-pages": "^3.1.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-id-generator": "^3.0.1",
"react-scripts": "4.0.1",
"web-vitals": "^0.2.4"
},
"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"
},
"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"
]
}
}
我部署了它,它正在运行:Todo List
推荐阅读
- excel - 在 Excel 中创建自定义函数(预览版)
- wordpress - 使用 wp_enqueue_scripts 将 css 和 js 链接到我的主题的 Wordpress 不起作用
- xamarin.forms - 评估平台
- android - 防止用户返回上一个屏幕 StackNavigator
- java - JVM 在哪里存储运行时实现的抽象类的信息?
- sql-server - 为什么在插入信息时我的值会重复?
- javascript - D3.js 旭日形按大小排序
- angular - 表格内的 PrimeNG 自动完成
- java - 请我需要有关清单合并失败并出现多个错误的解决方案
- amcharts - amCharts 已聚集但未堆叠