You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Keep this empty so that the emulator at startup asks for the value as defining IS_STAGING=true here would prevent the emulator from starting because of the issue described at the bottom of https://github.com/firebase/firebase-tools/issues/5313
Have a .env.my-staging-project-id file:
IS_STAGING=true
Have .env.local file:
FUNCTIONS_EMULATOR=true
Have a function in that references this parameter's value from .env.local:
...
if (defineBoolean('FUNCTIONS_EMULATOR').value() === true) {
...
}
...
Have some test that calls a Cloud Function.
[REQUIRED] Steps to reproduce
Execute the test run with firebase emulators:exec --import=./testdata/emulatordata \"npm test\"
-> The test just "silently" fails as it executes the wrong code as it seems the FUNCTIONS_EMULATOR parameter is not set correctly (based on the .env.local file) but there is no warning/output that it could not be loaded.
Just "start" the Firebase emulator using firebase emulators:start --import=./testdata/emulatordata --project default
-> It emits that it did not load the .env.local file:
? Enter a boolean value for IS_STAGING: false
i functions: Loaded environment variables from .env, .env.my-project-id.
i functions: Loaded environment variables from .env, .env.my-project-id.
i functions: Writing new parameter values to disk: .env.my-project-id
[REQUIRED] Expected behavior
It loads the .env.local file when using the emulator.
If it could not find a used environment variable, the warning for the missing variable is also emitted when executing the tests using firebase emulators:exec and not just when using firebase emulators:start.
[REQUIRED] Actual behavior
It does not load the .env.local file when using the emulator.
The warning of the "missing" environment variable is not emitted when executing the tests using firebase emulators:exec.
The text was updated successfully, but these errors were encountered:
This also seems to apply for a .secret.local file - it also does not seem to be loaded when using the emulator.
According to firebase-debug.log, it seems that even a secret that is defined in the .secret.local file is loaded from Google Cloud Secret Manager as there are log entries like
[debug] [2022-12-08T10:22:58.610Z] <<< [apiv2][status] GET https://secretmanager.googleapis.com/v1/projects/py-project-id/secrets/MY_SECRET 200
Hi @sceee, thanks for the information you provided. It seems like this ticket and #5313 is similar to the issue reported in #5219. With this, I’ll be closing this issue. If you have any other information you would like to add, please add them to #5219.
[REQUIRED] Environment info
firebase-tools: 11.17.0
Platform: Windows
[REQUIRED] Test case
Relates to #5313
.env
file:.env.my-project-id
file:.env.my-staging-project-id
file:.env.local
file:Have a function in that references this parameter's value from
.env.local
:Have some test that calls a Cloud Function.
[REQUIRED] Steps to reproduce
firebase emulators:exec --import=./testdata/emulatordata \"npm test\"
-> The test just "silently" fails as it executes the wrong code as it seems the FUNCTIONS_EMULATOR parameter is not set correctly (based on the
.env.local
file) but there is no warning/output that it could not be loaded.firebase emulators:start --import=./testdata/emulatordata --project default
-> It emits that it did not load the
.env.local
file:[REQUIRED] Expected behavior
.env.local
file when using the emulator.firebase emulators:exec
and not just when usingfirebase emulators:start
.[REQUIRED] Actual behavior
.env.local
file when using the emulator.firebase emulators:exec
.The text was updated successfully, but these errors were encountered: