question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing.

See original GitHub issue

Hey I’m just upgrading from the functions emulator, and trying to use the new functions framework, it appears to be working okay, but the console.logs, do not print to the console. I want to also do some testing with some admin SDK stuff but I get this error message.

FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing.

Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initializing firebase-admin will fail
Serving function...
Function: convertTileToWebP
URL: http://localhost:8080/

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

9reactions
thechenkycommented, Jun 26, 2019

Hi @stot3, if you’re using Firebase SDKs, we recommend running firebase serve command to emulate your functions. The documentation can be found here: https://firebase.google.com/docs/functions/local-emulator. You’re getting this error because the Firebase CLI sets both FIREBASE_CONFIG and GCLOUD_PROJECT env vars for your functions so that they have the needed information to work when deployed, whereas the functions framework emulator does not do this extra step.

8reactions
dvdmmccommented, Nov 27, 2019

In case this helps anyone else in the future. The issue with the local emulator is with debugging.
I was able to get functions-framework working with a Firebase project by setting a GCLOUD_PROJECT environment variable. the framework will then auto-calculate the corresponding FIREBASE_CONFIG values based off the GCLOUD_PROJECT variable only.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning, FIREBASE_CONFIG environment variable is ...
js Warning, FIREBASE_CONFIG environment variable is missing. Initializing firebase-admin will fail The behavior for Date objects stored in ...
Read more >
Configure your environment | Cloud Functions for Firebase
With this approach, you manually create a dotenv file for loading environment variables. Runtime environment configuration with the Firebase CLI and functions.
Read more >
Using Environment Variables | Cloud Functions Documentation
Updating runtime environment variables · Open the Functions Overview page in the Google Cloud console: · Click an existing function to go to...
Read more >
Node.js – Warning, FIREBASE_CONFIG environment variable ...
js Warning, FIREBASE_CONFIG environment variable is missing. Initializing firebase-admin will fail The behavior for Date objects stored in Firestore is going to ...
Read more >
问答- 腾讯云开发者社区-腾讯云
... FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. ... FIREBASE_CONFIG: Provides the following Firebase project config info: should i ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found