我正在尝试将我的React.js项目部署到Firebase上的辅助dev
托管站点,但是运行命令Error: Task ab14... failed: retries exhausted after 6 attempts
后得到firebase deploy --only hosting:dev
。
正如我在另一个项目上成功完成的那样,我通过运行firebase target:apply hosting dev dev-sitename-com
然后firebase target:apply hosting live live-sitename-com
来应用每个站点来设置托管。然后,我从
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"
}
}
要
{
"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"
}
}
我已删除node_modules并重新安装。我已经删除了构建文件夹并进行了重建。我尝试将GENERATE_SOURCEMAP从false设置为true。我仍然可以部署到live
目标,但不能部署到dev
,这应该表明问题所在。看起来其他一些具有相同问题的问题已经解决了几个小时,就像在Firebase方面一样,但是我怀疑是问题所在,因为实时部署将得以部署。从日志中看,部署似乎无法上载最后两个文件。日志还指示The "path" argument must be of type string. Received type undefined at validateString (internal/validators.js:107:11)
,它没有指向我代码中的任何位置。有关如何解决此问题的任何想法?
以下是部署时--debug的日志:https://pastebin.com/xhPZFnzr