Giter Site home page Giter Site logo

Comments (3)

af avatar af commented on July 23, 2024

After tweaking the example in the repo with your custom NODE_ENV validator, I'm not able to reproduce, I don't see that error and am able to verify that env.NODE_ENV is being set to staging. Could you share more of your application where you're seeing the error?

from envalid.

virkt25 avatar virkt25 commented on July 23, 2024

Hi @af, thanks so much for looking into this! After some extensive testing I don't think it's envalid.

I tried to recreate the problem in a example repo and it was actually a bit challenging BUT I finally figured out what might be the issue.


If you can have a look and give me any pointers that'd be great.

We are encapsulating envalid into a class, see the repo below. If the class is instantiated twice, then the error occurs ... otherwise everything works fine. Where we ran into the issue, the class was instantiated twice.

I haven't figured out why it might be causing this issue but any help would be appreciated -- though I'm certain now it's not envalid and rather how I'm using it.

Reproduction Repo: https://github.com/virkt25/envalid-test

from envalid.

af avatar af commented on July 23, 2024

Hmm, nothing jumps out at me immediately there, maybe there is some state being shared between instances somehow? Or perhaps the map isn't being initialized correctly the second time, although that should be evident from the logging you have in place...

Going to close this since it's not an issue with the library

from envalid.

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.