-
Notifications
You must be signed in to change notification settings - Fork 212
process.env.FIREBASE_CONFIG is not populated #596
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
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Hi, thanks for submitting your issue. What version of Firebase CLI |
Same behavior with [email protected] |
@stari4ek When you downgrade to Node8 do you face this error? We had related issues with Node10 several months back and that bug seems to have been fixed. Just want to confirm. |
With most recent firebase-tools (7.11.0).
code: import 'source-map-support/register';
import * as admin from 'firebase-admin';
const useServiceAccountCredentials: boolean = (() => {
if (process.env.FIREBASE_CONFIG === undefined) {
throw new Error('Missing FIREBASE_CONFIG');
}
...
})(); BTW, with nodejs10 deployment takes much longer till it fails and there is no error message from cli:
starts well in emulator:
|
@stari4ek I can't repro your error with the code snippet you provided. Can you run using the debug flag to see the full trace? |
I can't tell from your code snippet - but are you importing |
I do not import import { someFunc } from './someModule'
if (!process.env.FUNCTION_NAME || process.env.FUNCTION_NAME === 'someFunc') {
exports.someFunc = someFunc;
} Adding
does fix the issue. But |
@stari4ek To import a module just for its side effects, use this syntax: |
did check with I'm not sure if this is good practice in ts/js, but, honestly speaking, for me it looks more like implementation-specific stuff leaking outside the module during it's import. This issue could be closed. |
i have same problem, i use node 10, firebase-function 3.7.0 firebase-admin 8.10.0, |
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
Relevant Code:
I was trying to adopt https://firebase.google.com/docs/functions/config-env#automatically_populated_environment_variables.
Deploying firebase function (http) with:
makes deployment to fail.
From terminal:
In logs:
Removing access to
process.env.FIREBASE_CONFIG
fixes the issue.Local emulator works well with it
The text was updated successfully, but these errors were encountered: