{"record":{"id":"ebdb632927984117","repo":"sveltejs/kit","slug":"could-not-deserialize-binary-form-too-short","errorCode":null,"errorMessage":"Could not deserialize binary form: too short","messagePattern":"Could not deserialize binary form: too short","errorType":"exception","errorClass":"SvelteKitError","httpStatus":400,"severity":"error","filePath":"packages/kit/src/runtime/form-utils.js","lineNumber":246,"sourceCode":"\t\tfor await (const part of read_range(get_chunk, offset, length)) {\n\t\t\tparts.push(part);\n\t\t\ttotal += part.byteLength;\n\t\t}\n\t\tif (total < length || parts.length === 0) return null;\n\t\t// If the buffer is completely contained in one chunk, return the subarray as-is\n\t\tif (parts.length === 1) return parts[0];\n\n\t\tconst buffer = new Uint8Array(length);\n\t\tlet cursor = 0;\n\t\tfor (const part of parts) {\n\t\t\tbuffer.set(part, cursor);\n\t\t\tcursor += part.byteLength;\n\t\t}\n\t\treturn buffer;\n\t}\n\n\tconst header = await get_buffer(0, HEADER_BYTES);\n\tif (!header) throw deserialize_error('too short');\n\n\tif (header[0] !== BINARY_FORM_VERSION) {\n\t\tthrow deserialize_error(`got version ${header[0]}, expected version ${BINARY_FORM_VERSION}`);\n\t}\n\tconst header_view = new DataView(header.buffer, header.byteOffset, header.byteLength);\n\tconst data_length = header_view.getUint32(1, true);\n\tconst file_offsets_length = header_view.getUint16(5, true);\n\n\t// Validation uses embedded binary header fields (data_length, file_offsets_length)\n\t// rather than Content-Length, which proxies/middleboxes may strip or corrupt.\n\t// See: https://github.com/sveltejs/kit/issues/15299\n\n\t// Read the form data\n\tconst data_buffer = await get_buffer(HEADER_BYTES, data_length);\n\tif (!data_buffer) throw deserialize_error('data too short');\n\n\t/** @type {Array<number | undefined>} */\n\tlet file_offsets;","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/form-utils.js#L228-L264","documentation":"Deserialization guard for binary form bodies: fewer bytes arrived than the fixed header requires (the stream ended before HEADER_BYTES could be read), so the payload is truncated and cannot even be inspected for a version. Reported via deserialize_error with reason 'too short'.","triggerScenarios":"Thrown at packages/kit/src/runtime/form-utils.js:246 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the full serialized form payload is sent and not truncated by a proxy or size limit","Increase body size limits on the server/proxy","Retry the submission so a complete payload is produced"],"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"}