earendil-works/pi · error · CborError
CBOR byte length exceeds configured limit of
Error message
CBOR byte length exceeds configured limit of ${resolved.maxByteLength} What it means
The resolved maxByteLength option is smaller than the length of the input passed to decodeCbor, so the payload is rejected before decoding begins. Callers typically set this limit to bound memory use; a legitimate payload larger than the limit must be sent in smaller form or the limit raised.
Solutions
- Reduce the input size or raise resolved.maxByteLength in the decoder options.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/protocol/src/cbor/decoder.ts:165 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/bd67bf96988385da.
Report an issue: GitHub.
Appendix: source
Thrown at packages/protocol/src/cbor/decoder.ts:165
const value = this.bytes[this.offset]!;
this.offset++;
return value;
}
private readBytes(length: number): Uint8Array {
if (length > this.bytes.byteLength - this.offset) throw new CborError("Truncated CBOR payload");
const value = this.bytes.subarray(this.offset, this.offset + length);
this.offset += length;
return value;
}
}
/** Decodes exactly one item from the protocol's strict RFC 8949 subset. */
export function decodeCbor(bytes: Uint8Array, options?: CborOptions): unknown {
if (!(bytes instanceof Uint8Array)) throw new TypeError("CBOR input must be a Uint8Array");
const resolved = resolveOptions(options);
if (bytes.byteLength > resolved.maxByteLength) {
throw new CborError(`CBOR byte length exceeds configured limit of ${resolved.maxByteLength}`);
}
return new CborReader(bytes, resolved).decode();
}
View on GitHub (pinned to 4af9d21d3b)