Closed d-ivashchuk closed 1 year ago
@d-ivashchuk thanks for reaching out. Glad you like the library. There ist a known inkompatibility/bug with zod versions greater than 3.21.1.Maybe this could be the source of the type error?
I think I rubber duckked myself into solution. If you look at my tsconfigs - I am missing strict: true
. I tried to look at your example and just see what would make sense. It seems far better now!
Another thing that comes to my mind is that in some rare cases the prisma client index.d.ts
is not updated when changes in the prisma.schema
are made. This could also result in a type error. Furthermore there are some known issues with casing of the typenames as in #95 and #121
@d-ivashchuk did you have any more problems with this issue or is it resolved?
No, let's close it! The above mentioned fixes worked
hey @chrishoermann! thanks a lot for building this awesome library - I am now building the dream DX setup with full e2e type-safety, and zod-prisma-types fit well in it.
I experienced some problems with the simple generation, so it might be something I don't understand conceptually here:
I have a very minimalistic setup here, just newly generated lib inside NX monorepo.
My schema is super small as well:
Straight after running
npx prisma generate
I see the zod output which immediately throws some type errors at me. I guess it's not expected at all :/Maybe my tsconfigs would be of use here:
tsconfig.json
tsconfig.lib.json
would really appreciate any advice here, I think that zod-prisma-types is awesome addition to my flow and I really want to use it :D