【问题标题】:Firebase deploy keeps giving me an Error: Parse Error in remoteconfig.template.jsonFirebase 部署不断给我一个错误:remoteconfig.template.json 中的解析错误
【发布时间】:2021-02-20 00:08:27
【问题描述】:

我正在尝试使用 firebase 部署 Web 应用程序,但每次运行 deploy 时都会收到此错误

Error: Parse Error in remoteconfig.template.json:

No data, empty input at 1:1

^
File: "remoteconfig.template.json"

【问题讨论】:

    标签: android firebase firebase-cli firebase-remote-config


    【解决方案1】:

    您在firebase.json 文件中引用了remoteconfig.template.json,但该模板不存在。这通常看起来像:

      "remoteconfig": {
        "template": "remoteconfig.template.json"
      }
    

    解决方案是在您的 firebase.json 文件中找到此部分,然后将其删除。

    【讨论】:

    • 我不同意这种方法,因为我相信文件存在但为空。建议的方法将打破对remoteconfig 定义模板文件的引用(在这种情况下为remoteconfig.template.json)。我建议避免从firebase.json 文件中删除提及的部分,而是在模板中添加{ }文件,这将允许firebase deploy 工作。
    • 听起来像是一个很好的替代答案@BenjaminRAIBAUD :)
    【解决方案2】:

    您收到此错误是因为在您的 firebase init 中包含(或同意)远程配置。要使其与 deploy 一起使用,您必须像这样在文件 remoteconfig.template.json 中添加至少一个参数;

    {
        "example_minimum_score_for_level_2": 500
    }
    

    【讨论】:

      【解决方案3】:

      正如@BenjaminRAIBAUD 评论的那样,如果remoteconfig.template.json 为空,请尝试将{ } 添加到文件中。这对我有用。

      【讨论】:

        猜你喜欢
        • 2021-01-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-10-09
        • 2018-08-03
        • 2016-02-14
        • 1970-01-01
        相关资源
        最近更新 更多