-
Notifications
You must be signed in to change notification settings - Fork 147
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
"Type instantiation is excessively deep and possibly infinite" when using default: null #402
Comments
Yep, same here. |
+1 |
Is this issue resolved? We also experience the same? |
Is it resolved. Can't use undefined or null for default |
I found a solution, you have to cast your default to a type you want such as |
Problem
As per the FAQ, we can make things required by setting
default: null
, ifnull
is not a valid value.With TypeScript I get the error
Type instantiation is excessively deep and possibly infinite
when trying toconfig.get
any value, if somewhere in the schema there isdefault: null
.typescript 4.6.3
convict 6.2.1
@types/convict 6.1.1
(all versions latest at time of writing)
Repo here
https://github.com/noisyscanner/convict-issue
![image](https://user-images.githubusercontent.com/627654/160112464-45435862-990b-42a0-9976-089600606c71.png)
Run
yarn build
to see the followingThe text was updated successfully, but these errors were encountered: