I have encountered an issue while trying to set a deployment region for my functions. The documentation states that I should use the following code:
var functions = firebase.app().functions('us-west2');
However, when I implement this and attempt to deploy, an error arises:
Error: Error occurred while parsing your function triggers.
TypeError: Cannot read property 'onCall' of undefined
If I revert the functions definition back to the default setting:
const functions = require("firebase-functions");
Everything works as expected. Can anyone shed light on why this error is happening?
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) => {..}