-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Usage produces fatal error when .env file defines a variable with same name as expanded variable. #98
Comments
I second that request. My use case is that I'd like to use the So even if the CI sets a env var named MY_VAR to an empty string, the .env default value defined like And in the app I don't have to care the source of value, just rely on |
This seems to be a breaking change with a newer version 2020, too. I guess this part was never tested explicitly before.Sent from my iPhoneOn Apr 18, 2023, at 9:22 AM, Leandro Boscariol ***@***.***> wrote:
I second that request.
My use case is that I'd like to use the .env files to hold defaults for my env vars, and they have the same name externally as internally to reduce confusion.
So even if the CI sets a env var named MY_VAR to an empty string, the .env default value defined like MY_VAR=${MY_VAR:-DEFAULT} will be respected.
And in the app I don't have to care the source of value, just rely on MY_VAR
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
+1 on this request |
I stumbled on that issue as I was trying to set a default variable if it ever was not available. GID="${GID:-${GROUPS:-$UID}}" Let's admit that my case is a bit overcomplicated and only use the following: GID="${GID:-$UID}" I would still get the same error, while it is completely missing the point of the syntax, that is a valid one. Thanks for your time maintaining this awesome package 😄 |
No updates about this issue? |
same issue here |
same issue too. |
looking into this soon. thank you for your patience everyone. know it is frustrating. lots to keep up on! |
this is fixed in here is test demonstrating it is fixed: #111 any recursive call like this will now end up just returning the raw value it was set to. |
When I have a
.env
file like this, everything works fine:But this breaks:
This line causes the breakage:
Somehow the library cannot handle this situation.
Error produced:
Someone has already faced this issue and documented it somewhat:
https://stackoverflow.com/questions/49287598/maximum-call-stack-size-exceeded-from-dotenv-expand-on-circleci-using-react
You might ask the question: Why?
Using these versions:
The text was updated successfully, but these errors were encountered: