nuxt-community / firebase-module

🔥 Easily integrate Firebase into your Nuxt project. 🔥
https://firebase.nuxtjs.org
MIT License
641 stars 99 forks source link

Firebase function location not work #558

Open mickaelponsolle opened 3 years ago

mickaelponsolle commented 3 years ago

Version

"nuxt": "^2.15.7", "firebase": "^7.24.0", "@nuxtjs/firebase": "^6.1.1",

Steps to reproduce

Hi all ! I'm currently developing an SSR app deployed on Firebase (Hosting and Functions) I can deploy on the default location of Firebase functions (us-central1). But , as my users are in Europe, I want to deploy my app on a european location like europe-west1. I have followed the documentation of nuxt-firebase https://firebase.nuxtjs.org/service-options/functions/ and also https://firebase.google.com/docs/functions/locations#best_practices_for_changing_region The app is deployed but when I want to access to the app, I have a 403 error (Forbidden).

I missed surely something but I don't know what. I think to try another hosting solution : Cloud Run or App Engine. But it would be a pity to drop the firebase solution.

Have you some examples or hints for Firebase function location ?

simeon9696 commented 3 years ago

Did you call the function from the client properly?

var functions = firebase.app().functions('europe-west1');

adarsh4d commented 3 years ago

Also, check if you have hosted the function in the correct location europe-west1 on your firebase console.

There is a chance you might have hosted the function in us-central1, but trying to call it from europe-west1

ChrisvdLeij commented 2 years ago

Had the same issue. I was using this.$fireModule.functions.. which doesn't use the location set in the config.

The solution for me was to use this.$fire.functions. Which makes use of the location set in the config.