zenstack icon indicating copy to clipboard operation
zenstack copied to clipboard

@zenstackhq/trpc breaks with TypeScript error.

Open kirankunigiri opened this issue 6 months ago • 3 comments

Description and expected behavior The @zenstackhq/trpc that adds a trpc router for Prisma with ZenStack seems to break due to this TypeScript error: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.ts(7056)

Although the code still runs without transpilation, it causes issues with type completion in the IDE and makes type completions slow or completely breaks them and makes types show up as any. It looks like the types or too complex for it to handle. I've never seen an issue like this before though so I'm not sure how this could be fixed. I only have a few tables in my schema, so the types shouldn't be too complex.

Environment (please complete the following information):

  • ZenStack version: 2.3.3 (also using the same version for @zenstackhq/trpc)
  • Prisma version: 5.17.0
  • Database type: Postgresql

kirankunigiri avatar Jul 26 '24 18:07 kirankunigiri