earendil-works/pi · error · CborError

CBOR map keys must be strings

Error message

CBOR map keys must be strings

What it means

Error "CBOR map keys must be strings" thrown in earendil-works/pi.

Source

Thrown at packages/protocol/src/cbor/decoder.ts:67

				try {
					return textDecoder.decode(bytes);
				} catch (_error) {
					throw new CborError("CBOR text string contains invalid UTF-8");
				}
			}
			case 4: {
				const length = this.readLength(additionalInformation, "array", this.options.maxContainerLength);
				const result: unknown[] = [];
				for (let index = 0; index < length; index++) result.push(this.readItem(depth + 1));
				return result;
			}
			case 5: {
				const length = this.readLength(additionalInformation, "map", this.options.maxContainerLength);
				const result: Record<string, unknown> = {};
				const keys = new Set<string>();
				for (let index = 0; index < length; index++) {
					const key = this.readItem(depth + 1);
					if (typeof key !== "string") throw new CborError("CBOR map keys must be strings");
					if (keys.has(key)) throw new CborError("CBOR map contains a duplicate key");
					keys.add(key);
					Object.defineProperty(result, key, {
						configurable: true,
						enumerable: true,
						value: this.readItem(depth + 1),
						writable: true,
					});
				}
				return result;
			}
			case 6:
				throw new CborError("CBOR tags are not supported");
			case 7:
				return this.readSimple(additionalInformation);
			default:
				throw new CborError("Malformed CBOR major type");
		}

View on GitHub (pinned to 4af9d21d3b)

When it happens

Trigger: Thrown at packages/protocol/src/cbor/decoder.ts:67 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24). Data as JSON: /api/errors/a95e29fa7ae1948e. Report an issue: GitHub.