Giter Site home page Giter Site logo

Comments (4)

Nikaple avatar Nikaple commented on May 29, 2024 1

Thanks for your contribution! Closed by #278

from nest-typed-config.

Nikaple avatar Nikaple commented on May 29, 2024

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.

ilya-adnymics avatar ilya-adnymics commented on May 29, 2024

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.

ilya-adnymics avatar ilya-adnymics commented on May 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.