Using drizzle-zod with superforms
I am working on a SvelteKit app where i use Drizzle (0.30.2), drizzle-zod (0.8.2) and Svelte superforms (2.27.1)
This is my drizzle SQLite schema:
And i try to create a zod schema with
When i import this into a different file, and try to use it with
I get the error:
What am i doing wrong here? All the examples i am finding use it like this.
1 Reply
I think that drizzle-zod might be using zod4. If that is the case you need to use the zo4 adapter instead.
import { zod4 } from 'sveltekit-superforms/adapters';
await superValidate(zod4(datasetZodSchema)),
And the same for client validation if you are using that
import { zod4Client } from 'sveltekit-superforms/adapters';