-
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
7.3.0 breaking change? #185
Comments
I can't seem to reproduce this with my minimal test case (below). What is the value of ITierEnum in your case? I'm guessing it's a string enum?
|
My configuration works in 7.2 but not anymore in 7.3.
|
Hmm, the following test case still works for me using the enums:
Could you share some more of the traceback of that error? Are you using any custom middlewares? |
I just updated envalid to version 7.3.0 and noticed some environment variables relying on default values breaking with the update. I think it's related to this change: ef5a895 Previously, a default value for a custom validator doing eg. JSON parsing would be ran through that validator, causing issues if you tried to define the default value as an object (but satisfying TypeScript typings for the validator). Instead, we had to define the default values as strings, so that they could be properly parsed by the validator. |
@Pinqvin could you post a minimal repro case here? |
https://github.com/Pinqvin/envalid-repro With [email protected] the values you get for |
Thank you @Pinqvin for that, I think you are correct and this is unfortunately a breaking change that I should have highlighted:
So if you have default values for |
@af Is that an intended change? When we pass a JSON stringify to env, we expect it to be an |
The change should only apply to provided default values, the actual strings passed in through the env vars should still be converted from string -> object via JSON.parse as before. If that is not happening for you somehow please let me know |
@af Is not the output of the config is |
@veeramarni the output of the config should be the same as before, if the value is being provided from an actual env var. For example: given this foo.ts:
Running Regarding the initial issue you posted here, if you remove the |
We noticed errors related JSON type after our build takes 7.3.0 version
./policies
Error
The text was updated successfully, but these errors were encountered: