{"record":{"id":"851242005153ba17","repo":"earendil-works/pi","slug":"unsupported-cbor-value-type-typeof-value","errorCode":null,"errorMessage":"Unsupported CBOR value type: ${typeof value}","messagePattern":"Unsupported CBOR value type: (.+?)","errorType":"exception","errorClass":"CborError","httpStatus":null,"severity":"error","filePath":"packages/protocol/src/cbor/encoder.ts","lineNumber":207,"sourceCode":"\t\t\tif (entryValue !== undefined) entries.push([key, entryValue]);\n\t\t}\n\t\tif (entries.length > options.maxContainerLength) {\n\t\t\tthrow new CborError(`CBOR map length exceeds configured limit of ${options.maxContainerLength}`);\n\t\t}\n\t\tancestors.add(value);\n\t\ttry {\n\t\t\twriteArgument(writer, 5, entries.length);\n\t\t\tfor (const [key, entryValue] of entries) {\n\t\t\t\tencodeText(writer, key, options);\n\t\t\t\tencodeValue(writer, entryValue, options, depth + 1, ancestors);\n\t\t\t}\n\t\t} finally {\n\t\t\tancestors.delete(value);\n\t\t}\n\t\treturn;\n\t}\n\n\tthrow new CborError(`Unsupported CBOR value type: ${typeof value}`);\n}\n\n/** Encodes the protocol's strict, definite-length RFC 8949 subset. */\nexport function encodeCbor(value: unknown, options?: CborOptions): Uint8Array {\n\tconst resolved = resolveOptions(options);\n\tconst writer = new CborWriter(resolved.maxByteLength);\n\tencodeValue(writer, value, resolved, 0, new Set<object>());\n\treturn writer.finish();\n}\n","sourceCodeStart":189,"sourceCodeEnd":217,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/protocol/src/cbor/encoder.ts#L189-L217","documentation":"Error \"Unsupported CBOR value type: ${typeof value}\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/protocol/src/cbor/encoder.ts:207 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Only encode supported types: null, boolean, number, string, Uint8Array, arrays, plain objects, and Maps."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}