{"record":{"id":"4da887aa45775550","repo":"sveltejs/kit","slug":"could-not-deserialize-binary-form-no-body","errorCode":null,"errorMessage":"Could not deserialize binary form: no body","messagePattern":"Could not deserialize binary form: no body","errorType":"exception","errorClass":"SvelteKitError","httpStatus":400,"severity":"error","filePath":"packages/kit/src/runtime/form-utils.js","lineNumber":194,"sourceCode":"\t}\n\n\treturn {\n\t\tblob: new Blob(blob_parts)\n\t};\n}\n\n/**\n * @param {Request} request\n * @param {string} form_id\n * @returns {Promise<{ data: Record<string, any>; meta: BinaryFormMeta; form_data: FormData | null }>}\n */\nexport async function deserialize_binary_form(request, form_id) {\n\tif (request.headers.get('content-type') !== BINARY_FORM_CONTENT_TYPE) {\n\t\tconst form_data = await request.formData();\n\t\treturn { data: convert_formdata(form_id, form_data), meta: {}, form_data };\n\t}\n\tif (!request.body) {\n\t\tthrow deserialize_error('no body');\n\t}\n\n\tconst reader = request.body.getReader();\n\n\t/** @type {Array<Promise<Uint8Array<ArrayBuffer> | undefined>>} */\n\tconst chunks = [];\n\n\t/**\n\t * @param {number} index\n\t * @returns {Promise<Uint8Array<ArrayBuffer> | undefined>}\n\t */\n\tfunction get_chunk(index) {\n\t\tif (index in chunks) return chunks[index];\n\n\t\tlet i = chunks.length;\n\t\twhile (i <= index) {\n\t\t\t// chain reads so only one is ever pending — workerd forbids concurrent reads\n\t\t\tconst previous = chunks[i - 1] ?? Promise.resolve(undefined);","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/form-utils.js#L176-L212","documentation":"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.","triggerScenarios":"Thrown at packages/kit/src/runtime/form-utils.js:194 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the client actually sends the serialized binary body with the request","Check for intercepting proxies or middleware that strip the body","Handle the error and fall back to FormData submission"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}