'Firebase emulator cloud functions only works with default us-central1 location in Flutter [duplicate]

Context

when trying to call a firebase cloud function in the emulator from Flutter (tried both on Web & IOS), I always get an internal error if the location is set to anything but the default us-central1.

Error: [firebase_functions/internal] internal


Solution 1:[1]

It turns out that when I set up the Cloud Functions emulator, I have to specify the location too.

FirebaseFunctions.instanceFor(region: 'europe-west2').useFunctionsEmulator('localhost', 5001);

Note

That's is different from calling the function.

await FirebaseFunctions.instanceFor(region: 'europe-west2').httpsCallable('testFun3').call();

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Saif Hakeem