I have a simple cloud function running on the functions emulator:
exports.helloFirebase = functions.https.onCall((data, context) => {
return "Hello"
})
When I call it from my firebase app, as follows...
export default {
helloFirebase: httpsCallable(fucntions, "helloFirebase")
}
then...
functionsObj.helloFirebase()
.then((res) => {
console.log(res)
})
.catch((error) => {
console.log("ERROR IN FUNCTIONS")
console.log(error.message)
})
I get an error in my cloud functions console:
! functions: TypeError: Cannot read property 'data' of undefined
at processBackground (C:\Users\admin\AppData\Roaming\npm\node_modules\firebase-
tools\lib\emulator\functionsEmulatorRuntime.js:550:24)
at invokeTrigger (C:\Users\admin\AppData\Roaming\npm\node_modules\firebase-
tools\lib\emulator\functionsEmulatorRuntime.js:640:19)
at handleMessage (C:\Users\admin\AppData\Roaming\npm\node_modules\firebase-
tools\lib\emulator\functionsEmulatorRuntime.js:742:15)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
! Your function was killed because it raised an unhandled error.
I've tried everything to solve this issue and it's still not working. Is this a bug in the firebase admin SDK?