I got the Typescript error:
Property 'infer' does not exist on type 'typeof import(.../node_modules/zod/lib/external)
on the code:
const CampaignForm = z.infer<typeof CampaignSchema>;
Looking at the docs and node_modules the property is there.
The issue was using const instead of type.
Expected: type CampaignForm = z.infer<typeof CampaignSchema>;
Actual: const CampaignForm = z.infer<typeof CampaignSchema>;
The error is misleading.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With