{"record":{"id":"b32a4801a4531331","repo":"earendil-works/pi","slug":"cbor-map-keys-must-be-strings-b32a48","errorCode":null,"errorMessage":"CBOR map keys must be strings","messagePattern":"CBOR map keys must be strings","errorType":"exception","errorClass":"CborError","httpStatus":null,"severity":"error","filePath":"packages/protocol/src/cbor/encoder.ts","lineNumber":183,"sourceCode":"\t\tancestors.add(value);\n\t\ttry {\n\t\t\twriteArgument(writer, 4, value.length);\n\t\t\tfor (let index = 0; index < value.length; index++) {\n\t\t\t\tif (!Object.hasOwn(value, index) || value[index] === undefined) {\n\t\t\t\t\tthrow new CborError(\"CBOR arrays must not contain holes or undefined values\");\n\t\t\t\t}\n\t\t\t\tencodeValue(writer, value[index], 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\tif (isPlainObject(value)) {\n\t\tif (ancestors.has(value)) throw new CborError(\"CBOR values must not contain cycles\");\n\t\tfor (const symbol of Object.getOwnPropertySymbols(value)) {\n\t\t\tif (Object.prototype.propertyIsEnumerable.call(value, symbol)) {\n\t\t\t\tthrow new CborError(\"CBOR map keys must be strings\");\n\t\t\t}\n\t\t}\n\t\tconst entries: Array<readonly [string, unknown]> = [];\n\t\tfor (const key of Object.keys(value)) {\n\t\t\tconst entryValue = value[key];\n\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 {","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/protocol/src/cbor/encoder.ts#L165-L201","documentation":"Error \"CBOR map keys must be strings\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/protocol/src/cbor/encoder.ts:183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use string keys in objects and Maps; convert other key types to strings first."],"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"}