earendil-works/pi · error · CborError

Indefinite-length CBOR ${kind}s are not supported

Error message

Indefinite-length CBOR ${kind}s are not supported

What it means

Error "Indefinite-length CBOR ${kind}s are not supported" thrown in earendil-works/pi.

Source

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

				return null;
			case 27: {
				const bytes = this.readBytes(8);
				const value = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getFloat64(0, false);
				if (!Number.isFinite(value)) throw new CborError("Decoded CBOR number must be finite");
				if (Number.isInteger(value) && !Number.isSafeInteger(value)) {
					throw new CborError("Decoded CBOR integer is outside the safe range");
				}
				return value;
			}
			case 31:
				throw new CborError("CBOR break marker is not supported");
			default:
				throw new CborError("Unsupported CBOR simple value or floating-point width");
		}
	}

	private readLength(additionalInformation: number, kind: string, limit: number): number {
		if (additionalInformation === 31) throw new CborError(`Indefinite-length CBOR ${kind}s are not supported`);
		const length = this.readArgument(additionalInformation);
		if (length > limit) throw new CborError(`CBOR ${kind} length exceeds configured limit of ${limit}`);
		return length;
	}

	private readArgument(additionalInformation: number): number {
		if (additionalInformation < 24) return additionalInformation;
		switch (additionalInformation) {
			case 24:
				return this.readByte();
			case 25: {
				const bytes = this.readBytes(2);
				return bytes[0]! * 0x100 + bytes[1]!;
			}
			case 26: {
				const bytes = this.readBytes(4);
				return bytes[0]! * 0x1_000_000 + bytes[1]! * 0x1_0000 + bytes[2]! * 0x100 + bytes[3]!;
			}

View on GitHub (pinned to 4af9d21d3b)

Solutions

  1. Use definite-length CBOR encoding; indefinite-length items are not supported.

When it happens

Trigger: Thrown at packages/protocol/src/cbor/decoder.ts:113 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/ee75e7374c9a5315. Report an issue: GitHub.