Skip to content
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

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

Closed
ehmicky opened this issue May 9, 2024 · 3 comments · Fixed by #1035, #1037 or #1038
Closed

Comments

@ehmicky
Copy link
Collaborator

ehmicky commented May 9, 2024

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.

@ehmicky
Copy link
Collaborator Author

ehmicky commented May 9, 2024

PR at #1035.

@ehmicky
Copy link
Collaborator Author

ehmicky commented May 9, 2024

This is still happening but for older TypeScript versions: 5.1, 5.2 and 5.3.

@ehmicky
Copy link
Collaborator Author

ehmicky commented May 9, 2024

Still happening, but this time with TypeScript 4.8 and earlier...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant