question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

provided region for cloud functions is ignored

See original GitHub issue

Version info

Angular: 12.2.3

Firebase: 9.0.0

AngularFire: 7.0.0

Other (e.g. Ionic/Cordova, Node, browser, operating system): node: v14.17.0, chrome: 92.0.4515.159

How to reproduce these conditions

Failing test unit, Stackblitz demonstrating the problem

i could’t get angularfire 7 running in stackblitz, sorry.

Steps to set up and reproduce

  1. Setup a angualrfire 7 project
  2. use the provideFunctions method in the app.module.ts
  3. specify a region in the getFunctions function
@NgModule({
  ...
  imports: [
    provideFirebaseApp(() => initializeApp(environment.firebase)),
    provideFunctions(() => getFunctions(getApp(), 'europe-west1')),
  ],
  ...
})

Debug output

image The function is called from the default region even though I specified a region

Expected behavior

The function should be called with the region ‘europe-west1’

Actual behavior

The function is called with the default region ‘us-central1’

I think the provided region for cloud functions is ignored.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jamesdanielscommented, Aug 30, 2021

Cutting 7.0.1 now, which will have the fix. Thanks for catching this!

0reactions
GaneshVersionxcommented, Apr 7, 2022

getApp(), ’

Hmmm… good catch. It’s probably that the injected Functions instance is the “default” instance with respect to the SDK. Clearly I should prioritize the one that is passed to provideFunctions

In the meantime you should be able to access your function initialized with a region by injecting the FunctionsInstances array.

I’m not getting briefly explanation Please

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Cloud Functions - Google Cloud
The multi-region storage bucket stays available for that region, so that subsequent deployments can succeed. If you later decide to allowlist a region...
Read more >
What does functions/region config value actually do in ...
The gcloud config set command just says: Default region to use when working with Cloud Functions resources. When a --region flag is required ......
Read more >
Cloud Functions locations - Firebase - Google
Selecting regions based on Cloud Firestore and Cloud Storage locations. The available regions for functions do not always match precisely with the regions...
Read more >
session - Amazon Web Services - Go SDK
Package session provides configuration for the SDK's service clients. ... This includes credentials, region, and support for assume role.
Read more >
google_compute_region_instanc...
If self_link is provided, this value is ignored. If neither self_link nor project are provided, the provider project is used. region - (Optional)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found