[英]Failing to firebase deploy secondary hosting site
I am attempting to deploy my React.js project to a secondary dev
hosting site on Firebase, but I am getting Error: Task ab14... failed: retries exhausted after 6 attempts
after running the command firebase deploy --only hosting:dev
.我正在尝试将我的 React.js 项目部署到 Firebase 上的辅助
dev
托管站点,但出现Error: Task ab14... failed: retries exhausted after 6 attempts
运行命令firebase deploy --only hosting:dev
后 6 次尝试后重试耗尽。
As I have done successfully on another project, I setup hosting by running: firebase target:apply hosting dev dev-sitename-com
then firebase target:apply hosting live live-sitename-com
to apply each site.正如我在另一个项目上成功完成的那样,我通过运行设置托管:
firebase target:apply hosting dev dev-sitename-com
然后firebase target:apply hosting live live-sitename-com
以应用每个站点。 Then I change firebase.json
from然后我将
firebase.json
从
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
],
"source": "functions"
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
}
}
TO到
{
"hosting": [
{
"target": "live",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "dev",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
],
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
],
"source": "functions"
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
}
}
I've deleted node_modules and reinstalled.我删除了 node_modules 并重新安装。 I've deleted the build folder and rebuilt.
我删除了构建文件夹并重建了。 I've tried setting GENERATE_SOURCEMAP from false to true.
我试过将 GENERATE_SOURCEMAP 从 false 设置为 true。 I can still deploy to the
live
target, but not dev
, which should be indicative of the issue.我仍然可以部署到
live
目标,但不能部署到dev
,这应该表明存在问题。 Looks like some others with the same issue had the issue resolve over a few hours as it was on firebase's side, but I doubt is the issue because live will deploy.看起来其他一些有同样问题的人在几个小时内解决了这个问题,因为它是在 firebase 方面,但我怀疑是这个问题,因为 live 将部署。 From the logs it looks like the deploy is getting stuck on uploading the last 2 files.
从日志来看,部署似乎在上传最后 2 个文件时卡住了。 The logs also indicate
The "path" argument must be of type string. Received type undefined at validateString (internal/validators.js:107:11)
日志还指出
The "path" argument must be of type string. Received type undefined at validateString (internal/validators.js:107:11)
The "path" argument must be of type string. Received type undefined at validateString (internal/validators.js:107:11)
, which isn't directing anywhere in my code. The "path" argument must be of type string. Received type undefined at validateString (internal/validators.js:107:11)
,它没有指向我代码中的任何地方。 Any ideas on how to fix this?有想法该怎么解决这个吗?
Here are the logs for --debug when deploying: https://pastebin.com/xhPZFnzr以下是部署时 --debug 的日志: https://pastebin.com/xhPZFnzr
I solved this issue doing the following:我通过以下操作解决了这个问题:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.