{"record":{"id":"f3fde33205bb2167","repo":"sveltejs/kit","slug":"could-not-deserialize-binary-form-got-version-h","errorCode":null,"errorMessage":"Could not deserialize binary form: got version ${header[0]}, expected version ${BINARY_FORM_VERSION}","messagePattern":"Could not deserialize binary form: got version (.+?), expected version (.+?)","errorType":"exception","errorClass":"SvelteKitError","httpStatus":400,"severity":"error","filePath":"packages/kit/src/runtime/form-utils.js","lineNumber":249,"sourceCode":"\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;\n\t/** @type {number} */\n\tlet files_start_offset;\n\tif (file_offsets_length > 0) {","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/form-utils.js#L231-L267","documentation":"Deserialization guard for binary form bodies: the first header byte encodes the binary form format version, and it does not match BINARY_FORM_VERSION expected by this runtime — i.e. client and server were built with different serialization versions. deserialize_error reports both the received and expected version numbers.","triggerScenarios":"Thrown at packages/kit/src/runtime/form-utils.js:249 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rebuild/redeploy client and server from the same SvelteKit version so the format version matches","Clear cached stale service-worker/build assets holding the old serializer"],"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"}