Comments (4)
Thanks for your contribution! Closed by #278
from nest-typed-config.
Unfortunately, I can't reproduce the issue with the code you provided. Please provide a minimum reproduction repo with github or CodeSandbox.
The functionality to expand variables is covered in unit tests:
https://github.com/Nikaple/nest-typed-config/blob/main/tests/e2e/dotenv.spec.ts#L147
https://github.com/Nikaple/nest-typed-config/blob/main/tests/src/.expand.env
And latest unit test result seems fine too:
https://github.com/Nikaple/nest-typed-config/actions/runs/4423478314/jobs/7756255285#step:8:15
Note: Upgrading nest-typed-config
from v2.4.7 to v2.5.1 will bump the dependencies from dotenv@6
and dotenv-expand@5
to dotenv@16
and dotenv-expand@10
, maybe updating the dependencies in your project will help.
from nest-typed-config.
Thank you for looking into it!
I did exactly the steps to reproduce here: https://stackblitz.com/edit/nestjs-typescript-starter-othd9g and get the same error.
I didn't have neither dotenv
nor dotenv-expand
dependencies before nest-typed-config, so they come together and are on the versions you mentioned.
If this might help, the error for me was that in transpiled JS code in v2.5.1 the dotenvExpand
had an expand
method on it, i.e. it seems like an import/require issue.
I think this might be it: Breaking Move default export to export of expand function, happened in v6 of dotenv-expand.
from nest-typed-config.
Also, the unit tests are passing because the actual version of dotenv-expand that gets installed is 5.1.0. I.e. somehow version from optionalDependencies
"beats" the one from devDependencies
, and the tests pass.
If you bump version in optionalDependencies, test will fail.
from nest-typed-config.
Related Issues (20)
- Default values are overriding loaders? HOT 2
- Bug/Feature request: only load environment variables that are specified in the config file HOT 2
- [peerDependencies] Incompatible with nestjs version 9 HOT 1
- Default value is ignored if property is undefined
- env var substitutions break if the variable isn't set HOT 3
- Nested configs won't initialize if no environment variable of that nested config is set HOT 2
- Webpack builds in monorepos are broken HOT 2
- Request to update readme / docs to use ValidateNested instead of Allow where it makes sense HOT 1
- External Configuration "Validity" Check. HOT 2
- Build failed with version 2.5.0 HOT 1
- v2.5.0 has a failing build HOT 1
- optionalDependencies should be peerDependencies HOT 4
- Add ability to specify a default value for environment variable in the yaml file HOT 1
- New Release for NestJS 10 support HOT 1
- How to: async subset config sub modules? HOT 1
- Different throw exception behaviour on config syntax error when an array of loaders is given HOT 1
- Dependency lodash.set has an unpatched CVE HOT 1
- Add common production environment key/value parsing example HOT 1
- Environment Variable Substitution Not Working HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nest-typed-config.