I am trying to set a region to deploy my functions. According to the documentation I have to do:
var functions = firebase.app().functions('us-west2');
But when I do this and then try to deploy I get an error:
Error: Error occurred while parsing your function triggers.
TypeError: Cannot read property 'onCall' of undefined
If I change functions definitions back to default:
const functions = require("firebase-functions");
It works, any ideas why I get this error?
Sample Code: const firebase = require("firebase"); const admin = require("firebase-admin"); require("firebase-functions");
firebase.initializeApp({...})
admin.initializeApp()
let functions = firebase.app().functions('us-east1')
exports.findUserInAuth = functions.https.onCall((data, context) => {..}
firebase
, so it doesn't look complete to me. Also I'm not sure why you would require firebase-funcitons without doing something with the object it returns. You need that to build your Cloud Function defintion. – Doug Stevenson