I have a firebase cloud function, which gets the data from the cloud firestore.
const userSnapshot = await admin.firestore().collection('users').doc(user).get()
when this api is deployed locally using firebase emulators:start
.
I get the following error:
The Cloud Firestore emulator is not running so database operations will fail with a 'default credentials' error.
⚠ Google API requested!
- URL: "https://oauth2.googleapis.com/token"
- Be careful, this may be a production service.
> Auth error:Error: invalid_grant
This is happening only after updating the firebase-tools.
Previously it was working fine using firebase serve --only function --port=9000
.
In this tools version I am not able to set the port through command line.
This is resolved in 6.9.2
We can use firebase serve with port number to access firestore.
https://github.com/firebase/firebase-tools/issues/1265
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