gpt4 book ai didi

reactjs - 将 React App 部署到 Github Pages Yields Manifest : Line: 1, 列 : 1, 语法错误

转载 作者:行者123 更新时间:2023-12-05 01:31:40 24 4
gpt4 key购买 nike

我正在尝试在 Github Pages 中托管我的 React 应用程序。

我在一个基于 Vue 的项目上做过同样的事情,没有任何问题,但在 React 上,情况就不同了。

我已经阅读了以下教程:

我能够将应用程序部署到 Github Pages,但我看到以下错误:

Manifest: Line: 1, column: 1, Syntax error.

Error

是的,我的 list 在我的公用文件夹中,我不知道问题出在哪里。我已经尝试阅读与这个主题相关的各种 SO 问题,但没有找到任何相关的内容。

我也尝试创建一个 vanilla React 项目并遵循教程,但遇到了同样的问题。

这是我的 package.json 文件:

{
"name": "Random App Name",
"homepage": "https://github.com/TomerPacific/projectName",
"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.1",
"react-dom": "^17.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"
]
},
"devDependencies": {
"gh-pages": "^3.1.0"
}
}

这里发生了什么?问题是配置问题吗?

最佳答案

感谢@Kibonge Murphy 的建议,我检查了所有正在发出的网络请求的请求 url,发现它是错误的。

我没有将 Github 页面的 URL 作为 package.json 文件中的主页键,而是输入了存储库的 URL。

意义,

我应该放这个:https://tomerpacific.github.io/projectName/

代替 https://github.com/TomerPacific/projectName

关于reactjs - 将 React App 部署到 Github Pages Yields Manifest : Line: 1, 列 : 1, 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66034705/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com