I am trying to deploy my Firebase Cloud Functions using firebase deploy --only functions
. My functions do get successfully deployed, but I get this warning message in the console:
@firebase/database: FIREBASE WARNING: {"code":"app/invalid-credential","message":"Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: Error while making request: getaddrinfo ENOTFOUND metadata.google.internal. Error code: ENOTFOUND"."}
This is what I have at the top of my index.ts
:
import * as functions from "firebase-functions";
import * as admin from "firebase-admin";
admin.initializeApp({
credential: admin.credential.applicationDefault(),
databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
});
I have done export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-file.json"
.
How do I get rid of this warning message?