node.js - 具有 firebase : firebase. 功能的云功能不是功能

标签 node.js firebase google-cloud-functions

在使用 Firebase SDK 4.12.0 在 Firebase 上创建云函数 addMessage 后,尝试从我的客户端应用程序中调用 addMessage 函数时,以下代码不起作用:

var firebase = require("../node_modules/firebase")
var functions = firebase.functions();

functions.httpsCallable("addMessage").call(
    //...
)

类型错误:firebase.functions 不是函数

最佳答案

解决方案是添加 要求(“firebase/functions”)

关于node.js - 具有 firebase : firebase. 功能的云功能不是功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49480761/

相关文章:

google-cloud-functions - Google 云存储 `predefinedAcl` 和 `file.makePublic()` 不工作

android - 如何为分析添加 Firebase 自定义事件?

ios - 对于 google firebase 动态链接,预览页面为 (erf=1),即使安装了应用程序,该链接也会始终将您重定向到应用程序商店

arrays - Node.js promise : Push to array asynchronously & save

node.js - 有没有办法用 deno 请求 webpack

swift - 方法 'application:didRegisterUserNotificationSettings:' 的重复声明

javascript - Firebase数据库推送获取id

javascript - 如何使用云函数在 Firestore 中添加虚拟数据

node.js - child.stdout.on 适用于 read 但不适用 read -p

javascript - 点 m​​ongoos.connect at localhost mongodb