AF04

useForm received something other than a configuration object with a schema field.

In development this reads:

attaform useForm received an invalid configuration (a schema directly, no argument, or no schema field). Pass it as useForm({ schema }) — the schema is one of several configuration options. See https://attaform.dev/docs/reading-the-form/the-form for the full configuration shape.

What happened

The argument to useForm is an options bag, and the schema is one of several fields on it. Passing the schema directly (or nothing at all) is the most common first-run stumble, so Attaform names it precisely instead of failing deep inside the validator.

How to fix it

const schema = z.object({ email: z.string().email() })

// Instead of useForm(schema):
const form = useForm({ schema })

The form documents every configuration option.