Skip to content

Breaking V2 issue: arrays appear to no longer default correctly to [] in json mode #332

@fnimick

Description

@fnimick

Example: https://stackblitz.com/edit/superforms-2-tutorial-zod-wjgax7?file=src%2Froutes%2F%2Bpage.svelte

See that the array is defined as [] in debug, but causes an error on form submission with testArray: "Required"

In the schema, adding .default([]) to the array definition fixes the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingconfirmedConfirmed bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions