-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration Problem with the new process.env.FIREBASE_CONFIG #216
Comments
I have this similar issue. I have an Can you provide a specific example for the workaround? I tried adding
|
@zgosalvez As a temporary workaround, I've wrapped |
Thanks for filing! This issue is fixed in firebase-tools 3.18.1, which was just released. |
As always, thank you @laurenzlong. I tried deploying using the latest firebase-tools version but failed. No code changes on my part. I filed a new issue firebase/firebase-tools#722 which is still related to |
The fix works for me @zgosalvez with a single initializeApp() without the try catch, all back to normal. A fix + lib release in less than 22hrs since opening, |
@laurenzlong This is still an issue for me. Specifically, the error occurs at least in one of my HTTP trigger functions using express. Should I create a separate issue? |
Version info
Test case
I've migrated from functions beta to v1, but I'm having issues initializing firebase-admin since migrating.
My setup was a main index.ts which called
admin.initializeApp(functions.config().firebase);
at the top of my index.ts and then exports each firebase function below.Since the change from
admin.initializeApp(functions.config().firebase);
to the newadmin.initializeApp()
, I've been receiving the error:I've determined that even attempting to
console.log(process.env.FIREBASE_CONFIG)
from the top of my index.ts printsundefined
. However, printing the above from within each function export will print the config and allow me to initialize withadmin.initializeApp()
.It looks like I can workaround the change by adding
admin.initializeApp()
within each of my function exports, but I'd like to understand what's really going on. It's as ifprocess.env.FIREBASE_CONFIG
isn't set until each function is exported, whereas the beta versionfirebase.config().firebase
was available instantly.Is it recommended to initializeApp within each function?
The text was updated successfully, but these errors were encountered: