Describe the bug
When a form has an unchecked checkbox, and the checkbox schema is defined with z.coerce.boolean() (like suggested by the docs), the form can not be submitted. It stops working when I upgrade kit to 2.59.0.
Reproduction
import { form} from '$app/server';
import z from 'zod';
const schema = z.object({
canSubmitUnchecked: z.boolean().optional().transform((v) => v ?? false),
cannotSubmitUnchecked: z.coerce.boolean<boolean>(),
});
export const testForm = form(schema, async (data) => {
console.log(data);
});
https://stackblitz.com/edit/ji42wvw5?file=src%2Froutes%2F%2Bpage.svelte,src%2Froutes%2Ftest.remote.ts
Logs
System Info
Severity
serious, but I can work around it
Additional Information
No response
Describe the bug
When a form has an unchecked checkbox, and the checkbox schema is defined with
z.coerce.boolean()(like suggested by the docs), the form can not be submitted. It stops working when I upgrade kit to 2.59.0.Reproduction
https://stackblitz.com/edit/ji42wvw5?file=src%2Froutes%2F%2Bpage.svelte,src%2Froutes%2Ftest.remote.ts
Logs
System Info
Severity
serious, but I can work around it
Additional Information
No response