-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
expand local variables not working. #122
Comments
Wait are you saying that expanding local variables inside of a I honestly do not remember ever implementing that feature. It has been requested before, but I have not gotten around to implementing it yet. Someday soon hopefully! Currently, env expansion only works for arguments passed on the command line. This is sort of a duplicate of #97 |
I might be using the wrong term here but let me expand on my example with the above snippet. it might be up the chain and not related to env-cmd but I'm not 100% sure on that. I'll need to do some more research. The fix i've done for now is just assigning the url directly instead of referencing it within my env file. call the following env var inside my react app in v9.0.3 with craco and node version v10.15.3
network requests will map to
same code with v10.1.0 within a react app and craco on node v10.15.3 maps to the following and fails
|
Interesting...could you create a small functioning repo project demonstrating this issue that I can use to test with? I know it is a bit more work, but it would really help! Together, hopefully we can get this issue resolved 😄 |
This would be a great feature. @GeorgiosP Just tried this on v9.0.3 and the var was not expanded, so it may be up the tool chain somewhere. Not sure about CRA, but Next.js does this out-of-the-box. |
Possibly fixed in: #253 |
you can use HELLO="World"
HELLO2=$HELLO // index.js
console.log(`Hello ${process.env.HELLO}`)
console.log(`Hello ${process.env.HELLO2}`) dotenvx run -- node index.js |
running into an issue with expanding local variables inside an env file.
working in v9.0.3 with this setup but seems to fail once I've moved over to a new
CRA with env-cmd version 10.1.0
Request URL: http://localhost:5000/$REACT_APP_API_ENV_ORIGIN/
.env file:
package.json:
The text was updated successfully, but these errors were encountered: