-
-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
import type { SuperValidated, Infer } from "sveltekit-superforms";
import type { FormSchema } from "$routes/.../schemas";
type Props = { form: SuperValidated<Infer<FormSchema>>; };
let { form, ... }: Props = $props();
Since Zod 4.0.11, SuperValidated<Infer<FormSchema>>;
raises a Typescript error:
Type 'ZodObject<{ id: ZodOptional<ZodNumber>; protocol: ZodLiteral<"rtsp">; name: ZodString; host: ZodString; port: ZodCoercedNumber<unknown>; username: ZodString; password: ZodOptional<...>; path: ZodString; }, $strip>' does not satisfy the constraint 'Schema'.
Type 'ZodObject<{ id: ZodOptional<ZodNumber>; protocol: ZodLiteral<"rtsp">; name: ZodString; host: ZodString; port: ZodCoercedNumber<unknown>; username: ZodString; password: ZodOptional<...>; path: ZodString; }, $strip>' is not assignable to type 'TSchema | Schema<any, any, any, "">'.
Type 'ZodObject<{ id: ZodOptional<ZodNumber>; protocol: ZodLiteral<"rtsp">; name: ZodString; host: ZodString; port: ZodCoercedNumber<unknown>; username: ZodString; password: ZodOptional<...>; path: ZodString; }, $strip>' is missing the following properties from type 'TSchema': params, static, [Kind]ts(2344)

Workaround
Downgrading to Zod 4.0.10 resolves the issue.
Additional notes
The error is also present in the next versions of Zod: 4.0.11, 4.0.12, 4.0.13 (latest)
bastek338, raskyaldylla, sandapilarius, officialankan, RMalik777 and 21 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working