簡體   English   中英

firebase 部署二級托管站點失敗

[英]Failing to firebase deploy secondary hosting site

我正在嘗試將我的 React.js 項目部署到 Firebase 上的輔助dev托管站點,但出現Error: Task ab14... failed: retries exhausted after 6 attempts運行命令firebase deploy --only hosting:dev后 6 次嘗試后重試耗盡。

正如我在另一個項目上成功完成的那樣,我通過運行設置托管: 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 方面,但我懷疑是這個問題,因為 live 將部署。 從日志來看,部署似乎在上傳最后 2 個文件時卡住了。 日志還指出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) ,它沒有指向我代碼中的任何地方。 有想法該怎么解決這個嗎?

以下是部署時 --debug 的日志: https://pastebin.com/xhPZFnzr

我通過以下操作解決了這個問題:

  • 更新 firebase cli 並運行 firebase init
  • 刪除.firebase緩存文件夾

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM