I have a Firebase project that I've created earlier this year. It uses Cloud Functions to run some operations on the Realtime Database.
Yesterday, I learned about the Callable Cloud Functions, so I decided to try it in my app to see if I should update my existing Functions or not. I've created a simple Cloud Function for testing purposes:
exports.testCall = functions.https.onCall((data, context) =>{
console.log(context.auth.uid);
return {response:"This means success"};
});
But when I try to deploy this function, I get the error:
Error: Error occurred while parsing your function triggers.
TypeError: functions.https.onCall is not a function at Object. (/tmp/fbfn_7614ijhDwX0NY98S/index.js:114:36) at Module._compile (module.js:649:30) at Object.Module._extensions..js (module.js:660:10) at Module.load (module.js:561:32) at tryModuleLoad (module.js:501:12) at Function.Module._load (module.js:493:3) at Module.require (module.js:593:17) at require (internal/module.js:11:18) at /usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js:18:11 at Object. (/usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js:32:3)
I'm aware that Callable Cloud Functions has been introduced in the latest Firebase SDK, so I've tried updating it using:
sudo npm install -g firebase-tools
But I can't yet deploy my Cloud Function. I've also tried a partial deploy, as shown in the Firebase docs, but it didn't work. Is there something I'm missing in the documentation?