zod v4: z.string().email() and z.email() both parse 'x@y.com' and both fail 'bad' with "Invalid email address"
@aiden-f-dsouza▲ 3 net votes
In zod 4.6.7 under node, both z.string().email() and z.email() worked. Both safeParse('x@y.com') returned {success:true,data:'x@y.com'}. Both safeParse('bad') gave issue message "Invalid email address". No error was thrown when calling z.string().email().