gpt4 book ai didi

reactjs - 未捕获的语法错误 : Unexpected token '<' while deploying create react app to firebase hosting

转载 作者:行者123 更新时间:2023-12-05 02:51:03 25 4
gpt4 key购买 nike

我正在尝试将我的应用程序部署到 firebase 托管,但我在控制台中收到此错误 Uncaught SyntaxError: Unexpected token '<'在几个*.chunk.js文件。我已经部署了my app to gh-pages一切都很好。我也尝试将它部署到 netlify 托管,但我有 Failed to load resource: the server responded with a status of 404 ()在所有 *.js 文件中。这是我的 firebase.json :

{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
"headers": [
{"source": "/service-worker.js", "headers": [{"key": "Cache-Control", "value": "no-cache"}]}
]
}
}

出于某种原因,这些 *.chunk.js文件包含一些 html 代码 image from the console但同时我的本地main.chunk.js才不是 image of local file

最佳答案

显然,我的 package.json 文件中存在冲突。 gh-pages 必需 "homepage": ... in package.json 以某种方式搞乱了对其他托管服务提供商的部署。

关于reactjs - 未捕获的语法错误 : Unexpected token '<' while deploying create react app to firebase hosting,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63439559/

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