codelilac
DTDrizzle Team
•Created by codelilac on 6/24/2024 in #help
Struggling to use Zod with Drizzle... Type errors around |undefined
By default, Zod includes | undefined on fields with Zod.Optional(), this causes an issue since there’s a difference between a type that is set to undefined and getting ‘undefined’ from a variable, which is what that flag enforces checks for.
I’ve since switched to Drizzle Typebox which is quite a bit less headache and had this flag in mind from the get go :)
8 replies
DTDrizzle Team
•Created by codelilac on 6/24/2024 in #help
Struggling to use Zod with Drizzle... Type errors around |undefined
In your TS config, do you have
exactOptionalPropertyTypes
enabled? This is the flag that causes the issue8 replies
DTDrizzle Team
•Created by codelilac on 6/24/2024 in #help
Struggling to use Zod with Drizzle... Type errors around |undefined
this appears to be an issue with Zod itself, what a bummer
8 replies
DTDrizzle Team
•Created by codelilac on 6/24/2024 in #help
Struggling to use Zod with Drizzle... Type errors around |undefined
for added context:
8 replies