I am currently following this tutorial on youtube and at around the 26 minutes mark, the author is running his functions locally with the firebase serve
command.
This works fine for him, but as soon as I try to do that, I get the next error:
Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information. at GoogleAuth.getApplicationDefaultAsync (D:\\...\functions\node_modules\google-auth-library\build\src\auth\googleauth.js:161:19) at process._tickCallback (internal/process/next_tick.js:68:7)
Now, the error is giving me a link which helps me to solve this error, by setting an environment variable in my windows (which I don't like, because will this and how will this gonna work when I develop in different projects linked to different gmail accounts?)
Another solution I found, but not tested yet, is authenticate locally with a gcloud command gcloud auth application-default login
.
None of these steps is done by the author in the tutorial.
I searched in the comments of the video and someone mentioned that it has to do with the firebase-tools versions. His solution was to go back to firebase-tools version 6.8.0 while the current latest is 7.2.2.
So I wonder, what has changed that firebase serve with firebase-tools 7.2.2 isn't able to run a cloud function anymore when the cloud function tries to store something in a remote firestore database while this was working with firebase-tools 6.8.0?
And will it ever gonna work with version 7.2.2 or higher like it did with version 6.8.0?