I changed the location of my cloud functions from "us-central1" to "europe-west1" but I can't change the location of my functions on the client side which is a compulsory step for it to work according to the documentation.
(IDE tells me that no argument is expected on 'functions' when i do:
firebase.initializeApp(config).functions("europe-west1");
As an attempt to solve my problem I updated the three dependancies below with no result.
firebase-tools@latest firebase-functions@latest firebase-admin@latest
The problem is still here.
You should visit the following documentation page.
Use firebase.app.App.
https://firebase.google.com/docs/reference/js/firebase.app.App#functions
Not admin.app.App. The firebase-admin only use on the server side.
https://firebase.google.com/docs/reference/admin/node/admin.app.App
Set the specified regions for a client app.
var firebase = require("firebase/app");
require("firebase/functions");
var config = {
// ...
};
firebase.initializeApp(config).;
var functions = firebase.app().functions('europe-west1');
Set the specified regions for each function.
const functions = require('firebase-functions');
exports.webhookEurope = functions
.region('europe-west1')
.https.onRequest((req, res) => {
res.send("Hello");
});
If you are changing the specified regions for a function that's handling production traffic, you can prevent event loss by performing these steps in order:
- Rename the function, and change its region or regions as desired.
- Deploy the renamed function, which results in temporarily running the same code in both sets of regions.
- Delete the previous function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With