sveltejs/kit · error · SvelteKitError

Could not deserialize binary form: no body

Error message

Could not deserialize binary form: no body

What it means

Deserialization guard for binary-encoded remote form submissions: the request declares the binary form content type but its body stream is null/empty, so there is nothing to parse. deserialize_error wraps the reason ('no body') into a 'Could not deserialize binary form' error naming the failure stage.

Source

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

	}

	return {
		blob: new Blob(blob_parts)
	};
}

/**
 * @param {Request} request
 * @param {string} form_id
 * @returns {Promise<{ data: Record<string, any>; meta: BinaryFormMeta; form_data: FormData | null }>}
 */
export async function deserialize_binary_form(request, form_id) {
	if (request.headers.get('content-type') !== BINARY_FORM_CONTENT_TYPE) {
		const form_data = await request.formData();
		return { data: convert_formdata(form_id, form_data), meta: {}, form_data };
	}
	if (!request.body) {
		throw deserialize_error('no body');
	}

	const reader = request.body.getReader();

	/** @type {Array<Promise<Uint8Array<ArrayBuffer> | undefined>>} */
	const chunks = [];

	/**
	 * @param {number} index
	 * @returns {Promise<Uint8Array<ArrayBuffer> | undefined>}
	 */
	function get_chunk(index) {
		if (index in chunks) return chunks[index];

		let i = chunks.length;
		while (i <= index) {
			// chain reads so only one is ever pending — workerd forbids concurrent reads
			const previous = chunks[i - 1] ?? Promise.resolve(undefined);

View on GitHub (pinned to 03f1687fe6)

Solutions

  1. Ensure the client actually sends the serialized binary body with the request
  2. Check for intercepting proxies or middleware that strip the body
  3. Handle the error and fall back to FormData submission
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/kit/src/runtime/form-utils.js:194 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/4da887aa45775550. Report an issue: GitHub.