简体   繁体   English

firebase 部署二级托管站点失败

[英]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:我通过以下操作解决了这个问题:

  • update firebase cli and run firebase init更新 firebase cli 并运行 firebase init
  • delete.firebase cache folder删除.firebase缓存文件夹

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase 托管部署失败 - Firebase hosting deployment failing 在 Firebase 托管中部署 React 项目 - Deploy React Project in Firebase Hosting Firebase deploy --only 托管不会更新 React.js webapp 内容,除非站点数据被清除 - Firebase deploy --only hosting does not update React.js webapp content unless site data is cleared Firebase 部署到另一个站点 - Firebase deploy to another site 无法将React 16应用部署到Firebase托管 - Impossible to deploy a React 16 app to Firebase hosting 从 Gitlab 反应部署到 Firebase 失败并显示错误:指定的公共目录“build”不存在,无法将托管部署到站点 - React Deployment to Firebase from Gitlab fails with error: to Specified public directory 'build' does not exist, can't deploy hosting to site 部署后“Firebase 托管设置完成” - "Firebase Hosting Setup Complete" after deploy Firebase 部署抛出错误“托管密钥和旧托管密钥都存在于 firebase.json 中。” - Firebase deploy throws error "Hosting key and legacy hosting keys are both present in firebase.json." 部署到 firebase 托管后,我的 React 项目无法运行 - My react project not working after deploy to firebase hosting Firebase 使用 Google Cloud Build 进行托管部署会引发“没有此类文件或目录”错误 - Firebase Hosting deploy with Google Cloud Build throwing “No such file or directory” error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM