Skip to content
This repository was archived by the owner on Sep 1, 2026. It is now read-only.

TS2590: "Expression produces a union type that is too complex to represent" on generics types #2683

Description

Steps to reproduce

Repository: https://github.com/victorgarciaesgi/regle/tree/FRONT/experimental/tsgo
Branch: experimental/tsgo

  1. Run npx corepack enable pnpm to install the correct package manager
  2. Run nvm use
  3. Run pnpm install
  4. Run pnpm run build to build all monorepo packages

Then run pnpm run typecheck --filter="@regle/core"
Or pnpm run typecheck --filter="@regle/rules"

Behavior with typescript@5.9

No type error, inference works well as it can be seen here in playground

Behavior with tsgo

tsgo produces the same error on a lot of generics, saying Expression produces a union type that is too complex to represent.

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions