【问题标题】:'firebase deploy' compilation error in storage.rulesstorage.rules 中的“firebase deploy”编译错误
【发布时间】:2016-09-15 23:53:01
【问题描述】:

我正在尝试从 here 部署 firebase 应用程序,我正在关注 this 教程。我想部署我的 firebase 应用程序。但是,当我输入

firebase deploy

我得到一个错误。这是我的日志:

egaumbp:web gg$ firebase deploy

=== Deploying to 'friendlychat-6e4c3'...

i  deploying database, storage, hosting
i  storage: checking rules for compilation errors...

Error: Compilation error in storage.rules:

[E] 3:12 - Unexpected '<'.
egaumbp:web gg$ 

我已登录,并且我拥有 3.0.0 版的 firebase 工具包,我正在使用 MacBook Pro(Retina,13 英寸,2012 年末)在 OSX EL Capitan 版本 10.11.2 上执行此操作。

【问题讨论】:

    标签: javascript firebase firebase-security firebase-realtime-database firebase-hosting


    【解决方案1】:

    入门指南中的许多示例都使用&lt;placeholder&gt; 的约定,开发人员需要提供一些附加信息才能使示例功能发挥作用。在Understanding Firebase Storage Security Rules 的第一个示例中,以下代码 sn-p 使用占位符 &lt;your-firebase-storage-bucket&gt; 呈现。

    service firebase.storage {
      match /b/<your-firebase-storage-bucket>/o {
        // ... more rules ...
      } 
    }
    

    要修复这种情况下的Unexpected '&lt;' 错误,请将占位符替换为friendlychat-6e4c3.appspot.com,如下所示:

    service firebase.storage {
      match /b/friendlychat-6e4c3.appspot.com/o {
        // ... more rules ...
      } 
    }
    

    Learn to Secure Files 提供了支持的语法和函数的详细概述。如果遇到更多的编译错误,这是一个很好的参考。

    【讨论】:

    • 我正在做你在回答这个friendly-chat-4bd7c.appspot.com/o 时提到的事情,但仍然遇到同样的错误
    猜你喜欢
    • 1970-01-01
    • 2021-05-12
    • 2018-10-12
    • 1970-01-01
    • 2022-01-01
    • 2019-08-30
    • 2018-09-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多