After creating a cloud function addMessage
on Firebase using Firebase SDK 4.12.0, the following code does not work when attempting to call the addMessage
function from within my client app:
var firebase = require("../node_modules/firebase")
var functions = firebase.functions();
functions.httpsCallable("addMessage").call(
//...
)
TypeError: firebase.functions is not a function
答案 0 :(得分:4)
The solution was to add
require("firebase/functions")