Skip to content

TypeScript Error TS2590: Expression produces a union type that is too complex to represent. #1034

@ehmicky

Description

@ehmicky

Since Execa 9.0.0, when using TypeScript 5.1 or later, the following type error appears:

types/subprocess/stdout.d.ts:18:4 - error TS2590: Expression produces a union type that is too complex to represent.

18  : InputOutputStream<IsInputFd<FdNumber, OptionsType>>;

Or:

types/return/result-stdout.d.ts:33:4 - error TS2590: Expression produces a union type that is too complex to represent.

 33  : ResultStdioItem<
 34  IsObjectFd<ObjectFdNumber, OptionsType>,
... 
 36  OptionsType['encoding']
 37  >;

Apparently the error is not emitted when using tsd, only when using tsc, which is why our type tests did not catch this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions