So, I'm working on a React project which uses Firebase to achieve lots of functionalities. And now I'm trying to use some HTTPS callable functions in it.
But it seems like the way I import the 'firebase/functions' module is not correct. And it's giving me this error:
TypeError: Cannot read property 'httpsCallable' of undefined
Below is how I do the import and set up:
import app from 'firebase/app';
import 'firebase/auth';
import 'firebase/firestore';
import 'firebase/functions';
const config = {
// the config info here
};
class Firebase {
constructor() {
app.initializeApp(config);
this.auth = app.auth();
this.db = app.firestore();
this.functions = app.functions();
}
// trying to call the function
doCreatePlanner = this.functions.httpsCallable('createPlanner')
Can anyone point me to the right direction?