sveltejs/kit · error

${type === 'radio' ? 'Radio' : 'Checkbox array'} inputs must

Error message

${type === 'radio' ? 'Radio' : 'Checkbox array'} inputs must have a value

What it means

Dev-time validation in the form element prop builder: radio buttons and checkbox arrays encode their choice as the input's value attribute, so it cannot be omitted. This fires when creating a radio or multi-checkbox input through the remote form machinery without providing the option value as the second argument.

Source

Thrown at packages/kit/src/runtime/form-utils.js:845

				if (type === 'select' || type === 'select multiple') {
					return add_props(base_props, {
						multiple: is_array,
						value: () => {
							const value = read(input_value);
							// copied, so the state array can't be edited through the props
							return Array.isArray(value) ? [...value] : value;
						}
					});
				}

				// Handle checkbox inputs
				if (type === 'checkbox' || type === 'radio') {
					// radio and checkbox array inputs take their option as the second argument
					// and whether it is checked as the third, a single checkbox only the latter
					const has_option = type === 'radio' || is_array;

					if (DEV && has_option && !input_value) {
						throw new Error(
							`${type === 'radio' ? 'Radio' : 'Checkbox array'} inputs must have a value`
						);
					}

					if (has_option) {
						base_props.value = input_value ?? 'on';
					} else {
						checked = /** @type {boolean | undefined} */ (input_value);
					}

					return add_props(base_props, {
						defaultChecked: checked,
						checked: () => {
							const value = read();
							if (value == null) return read(checked);
							if (type === 'radio') return value === input_value;
							if (is_array) return /** @type {unknown[]} */ (value).includes(input_value);
							return value;

View on GitHub (pinned to 03f1687fe6)

Solutions

  1. Provide the option value: field('radio', 'choice', { value: 'choice' }) or pass it as the input's second argument
  2. Use a plain checkbox (single boolean) if no per-item value is needed
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/kit/src/runtime/form-utils.js:845 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02). Data as JSON: /api/errors/0cc3c9f1bdbb62b2. Report an issue: GitHub.