Skip to content
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

Load project-specific environment variables in the Functions Emulator #4273

Merged
merged 7 commits into from Mar 14, 2022

Conversation

taeold
Copy link
Contributor

@taeold taeold commented Mar 9, 2022

Today, Functions Emulator does not load project-specific environment variables. This contradicts the public documentation which states:

When using a local Cloud Functions emulator, you can override environment variables for your project by setting up a .env.local file. Contents of .env.local take precedence over .env and the project-specific .env file.

https://firebase.google.com/docs/functions/config-env#emulator_support

The patch fixes the bug by making appropriate changes to load project-specific environment variables (either in .env.projectId or .env.projectAlias) when emulating functions.

Fixes #4239

src/functions/env.ts Outdated Show resolved Hide resolved
@taeold taeold enabled auto-merge (squash) March 14, 2022 17:01
@taeold taeold merged commit 0c897b3 into master Mar 14, 2022
@bkendall bkendall deleted the dl-cf3-emulator-load-project-envs branch March 18, 2022 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project-specific .env files aren't loaded when running functions emulator
3 participants