Skip to content

"Type instantiation is excessively deep and possibly infinite" when using default: null #402

@noisyscanner

Description

@noisyscanner

Problem

As per the FAQ, we can make things required by setting default: null, if null is not a valid value.

With TypeScript I get the error Type instantiation is excessively deep and possibly infinite when trying to config.get any value, if somewhere in the schema there is default: 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
Run yarn build to see the following
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions