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

[BUG]: drizzle-valibot throws Type instantiation is excessively deep and possibly infinite. for refinements #3751

Open
1 task done
MickL opened this issue Dec 11, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@MickL
Copy link

MickL commented Dec 11, 2024

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

0.38.0

What version of drizzle-kit are you using?

0.30.0

Other packages

valibot@1.0.0-beta.9, drizzle-valibot@0.3.0

Describe the Bug

When creating a drizzle-valibot refinement, with either createSelectSchema, createInsertSchema or createUpdateSchema it throws a TypeScript error:

TS2589: Type instantiation is excessively deep and possibly infinite.
Bildschirmfoto 2024-12-11 um 17 39 51

I made a reproduction repo that uses the examples from the docs for Valibot, Zod and Typebox, but the error occurs only for Valibot:

https://github.com/MickL/drizzle-valibot-type-error

@L-Mario564

@MickL MickL added the bug Something isn't working label Dec 11, 2024
@MickL
Copy link
Author

MickL commented Dec 11, 2024

This can be resolved by adding strict: true for the moment. But @L-Mario564 told me "I'll try to make it work without strict, but will require some effort to do so" so I leave this open hoping it will work one day without strict :)

@camflan
Copy link

camflan commented Dec 11, 2024

@MickL fwiw, I'm seeing a similar error (#3738) and we have strict: true set in our project

@juan-calle
Copy link

I'm also getting this error when using createSelectSchema with pgEnum
Screenshot 2024-12-16 at 15 50 28

@trevorpfiz
Copy link

@MickL fwiw, I'm seeing a similar error (#3738) and we have strict: true set in our project

I am seeing this with drizzle-zod, even with strict: true. I am thinking from this:

content: t
      .jsonb()
      .$type<CoreMessage>()
      .notNull()
      .default(sql`'{}'::jsonb`),

@kevinlaw91
Copy link

Also happened in drizzle-orm@0.38.2 with drizzle-zod@0.6.0

createInsertSchema(account, {
  // Typescript enum
  statusId: z.nativeEnum(AccountStatus)
    .default(AccountStatus.VERIFY),
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants