firebase-module icon indicating copy to clipboard operation
firebase-module copied to clipboard

Firebase function location not work

Open mickaelponsolle opened this issue 3 years ago • 3 comments

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 ?

mickaelponsolle avatar Jun 29 '21 20:06 mickaelponsolle

Did you call the function from the client properly?

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

simeon9696 avatar Jul 01 '21 12:07 simeon9696

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

adarsh4d avatar Jul 04 '21 04:07 adarsh4d

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.

ChrisvdLeij avatar Aug 11 '21 09:08 ChrisvdLeij