【问题标题】:Error getting a Firebase function configured - Failed to configure trigger配置 Firebase 功能时出错 - 无法配置触发器
【发布时间】:2020-11-02 22:17:48
【问题描述】:

我收到此错误,但找不到原因

错误:

Failed to configure trigger providers/cloud.firestore/eventTypes/document.create@firestore.googleapis.com

功能:

const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();

exports.newSubmit = functions.firestore
    .document('usersSubmit/{id}')
    .onCreate(() => {
        console.log('new document created');
    });

集合 usersSubmit 确实作为根集合存在。是我的函数还是 Cloud Functions 遇到了困难?

【问题讨论】:

  • 如果您在部署期间收到无用的错误消息,请联系 Firebase 支持以获取个性化帮助。 support.google.com/firebase/contact/support
  • 请查看此post 以解决相同的问题。请检查您是否有最新版本的 Firebase CLI 和 firebase-functions SDK?
  • 本周全新安装。我似乎已经开始工作了,在集合名称之前添加一个正斜杠,如下所示:'/usersSubmit/{id}'
  • 您还可以发布有关正斜杠的答案以帮助其他社区成员。

标签: firebase google-cloud-firestore google-cloud-functions


【解决方案1】:

简单!我必须在根集合之前添加一个正斜杠。

.document('/usersSubmit/{id}')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-04-01
    • 2021-05-07
    • 1970-01-01
    • 1970-01-01
    • 2021-08-22
    • 2020-09-16
    • 2018-11-21
    相关资源
    最近更新 更多