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

TS cache corruption leads to "error TS2590: Expression produces a union type that is too complex to represent" #58301

Closed
jayshah123 opened this issue Apr 24, 2024 · 4 comments
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@jayshah123
Copy link

jayshah123 commented Apr 24, 2024

🔎 Search Terms

"typescript cache corruption", "typescript Expression produces a union type that is too complex to represent", "tsconfig.tsbuildinfo"

🕗 Version & Regression Information

  • This is a error during typechecking.
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about caching.
  • I was unable to test this on prior versions because hard to migrate large codebase
  • Using typescript@4.9.5

⏯ Playground Link

NA

💻 Code

A large codebase

🙁 Actual behavior

error TS2590: Expression produces a union type that is too complex to represent

🙂 Expected behavior

No type errors

Additional information about the issue

We have a build pipeline that uses typescript type checking with "incremental": true on our top level project.
We also have a tsconfig.tsbuildinfo generated at regular intervals from our master branch, and use it for ts caching in various branches in CI.

Ocassionally, we run into "error TS2590: Expression produces a union type that is too complex to represent", but it goes away once we clear/delete tsconfig.tsbuildinfo file. and re-run tsc/type-checker.

@RyanCavanaugh RyanCavanaugh added the Needs More Info The issue still hasn't been fully clarified label Apr 24, 2024
@RyanCavanaugh
Copy link
Member

We need a way to repro this. You'll also need to try this on the most recent TS release (5.4) before we can investigate - it's very possible this was fixed since 4.9

@jayshah123
Copy link
Author

jayshah123 commented Apr 29, 2024

Is there a way we can invoke TSC to print more debugging info on the offending types?
This will help us come up with a reproducible use case.
Also any relevant internal file where we can enable logging is fine.

@RyanCavanaugh
Copy link
Member

We don't have any debugging flags like that. The best thing you can do is run tsc.js in a debugger with a breakpoint on the line that issues the error and inspect the call stack at tha tpoint

@jayshah123
Copy link
Author

Will re-open after I have sufficient debugging info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Info The issue still hasn't been fully clarified
Projects
None yet
Development

No branches or pull requests

2 participants