Set functions’ region depending on whether emulator or live
the ‘functionsRegion’ method returns a value depending on whether it is under an emulator or live server.
If you ser your region somewhere, not default region (us-central1), you have to set a region when you call functions like this.
firebase.app().functions('your-region').httpsCallable("function-name")
But if you call your localhost function, you have to rid of the region parameter, and call the function ‘useFunctionsEmulator’ before to call functions
c.f.
useFunctionsEmulator is now deprecated in the latest version of Firebase SDK. Check the document.