Closed BenJackGill closed 5 months ago
I found a few problems with this issue:
The difficulty here is that other implementations of .env
configuration files in Javascript-based projects seem to have settled on FOO=
being a valid thing to have in your file. This includes both the default .env handler in Node.js, and the dotenv package that was popular for supporting .env files before Node added that feature. Erroring when we see an empty line in a .env file, or setting the value to null instead of "", would be very surprising behavior for people used to those other libraries.
I'm sorry that the current behavior is annoying you, but I think I have to call it working as intended.
Fair enough :)
Related issues
None
[REQUIRED] Version info
node: v18.17.0 firebase-functions: 4.5.0 firebase-tools: 13.0.1 firebase-admin: 12.0.0
[REQUIRED] Steps to reproduce
It is common practice to provide an
.env.example
file with empty variables to show what is required in the.env
file:That
.env.example
file often gets copied and renamed for actual use, for example, to.env.PROJECT_ID
, and variables are assigned a value:Then for Firebase Functions we might have a parameterized variable definition that looks like this:
When
.env.PROJECT_ID
contains a value (e.g.MY_VARIABLE="foo"
), the deployment functions correctly.However, if someone copies
.env.example
without adding a value toMY_VARIABLE
(resulting inMY_VARIABLE=
in.env.PROJECT_ID
), the expected behavior would be for Firebase Functions deployment to prompt for this value because it is required by the parameterized configuration. But that does not happen.Currently, the deployment proceeds without any prompt or error even though
MY_VARIABLE
is empty.This can lead to deployments with incomplete or incorrect configurations, potentially causing runtime errors or unexpected behavior.
Were you able to successfully deploy your functions?
Yes I can successfully deploy (which is the problem here). I did not see any error messages.