将Reaction App部署到Github页面生成清单:行:1,列:1,语法错误 [英] Deploying React App To Github Pages Yields Manifest: Line: 1, column: 1, Syntax error
本文介绍了将Reaction App部署到Github页面生成清单:行:1,列:1,语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在Github页面中托管我的Reaction应用程序。
我用基于Vue的项目做过同样的事情,没有问题,但用Reaction,事情就不同了。
我已经复习了以下教程:
我能够将应用程序部署到Github页面,但看到以下错误:
是,我的清单在我的公用文件夹中找到,但我不知道问题的根源。 我试着阅读了与此主题相关的各种SO问题,但没有找到任何相关的问题。清单:行:1,列:1,语法错误。
我还尝试创建一个Vanilla Reaction项目并按照教程进行操作,但遇到了相同的问题。
这是我的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
这篇关于将Reaction App部署到Github页面生成清单:行:1,列:1,语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文