-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Possible double-recursive expansion regression #120
Comments
this appears to be working correctly @mschoeffmann. here's a test demonstrating it. https://github.com/motdotla/dotenv-expand/pull/121/files what does your dotenv.config and dotenvExpand code look like? keep in mind we removed |
The variable My corresponding part of my app's config is: console.log('BEFORE >>>'); // for demo
Object.entries(process.env).map((x) => x[0].indexOf('PUBLIC_') >= 0 && console.log(x)); // for demo
const devEnv = dotenv.config({ path: path.resolve(require.main.path, '../../.env') });
dotenvExpand.expand(devEnv);
console.log('AFTER >>>'); // for demo
Object.entries(process.env).map((x) => x[0].indexOf('PUBLIC_') >= 0 && console.log(x)); // for demo The corrsponding .env entries:
Outputs:
So, sorry, it's not about the variable itself, it's about the double recursion: PUBLIC_BASE_URL < PUBLIC_DOMAIN < DEVCONTAINER_CADDY_PUBLIC_DOMAIN |
confirmed issue here: #121 sorry about this. working on patch. |
that one was tricky to track down but is done now. https://github.com/motdotla/dotenv-expand/pull/121/files install 11.0.5 and you should be all set |
I can confirm: 11.0.5 is working. |
In addition to #117, there is also a breaking change when referencing a "real" env variable from a .env file.
For example:
Variable (set in docker environment):
APP_DOMAIN=example.com
Variable (set in .env):
BASE_URL=https://${APP_DOMAIN}/api/
Results in
https://${APP_DOMAIN}/api/
.In v10 it was correct:
https://example.com/api/
The text was updated successfully, but these errors were encountered: