earendil-works/pi · error · TypeError
PiServer maxFrameLength must be an integer between 1 and ${M
Error message
PiServer maxFrameLength must be an integer between 1 and ${MAX_UINT32} What it means
Error "PiServer maxFrameLength must be an integer between 1 and ${MAX_UINT32}" thrown in earendil-works/pi.
Source
Thrown at packages/server/src/server.ts:385
this.reportError(error);
return { code: "internal_error", message: INTERNAL_SERVER_ERROR_MESSAGE };
}
private reportError(error: unknown): void {
try {
this.onError?.(error instanceof Error ? error : new Error(String(error)));
} catch {
// Error observers cannot affect server state.
}
}
}
function resolveOptions(options: PiServerOptions): { maxFrameLength: number; handshakeTimeoutMs: number } {
if (!Array.isArray(options.listeners)) throw new TypeError("PiServer listeners must be an array");
if (options.serverId === "") throw new TypeError("PiServer serverId must not be empty");
const maxFrameLength = options.maxFrameLength ?? DEFAULT_MAX_FRAME_LENGTH;
if (!Number.isSafeInteger(maxFrameLength) || maxFrameLength <= 0 || maxFrameLength > MAX_UINT32) {
throw new TypeError(`PiServer maxFrameLength must be an integer between 1 and ${MAX_UINT32}`);
}
const handshakeTimeoutMs = options.handshakeTimeoutMs ?? DEFAULT_HANDSHAKE_TIMEOUT_MS;
if (
!Number.isSafeInteger(handshakeTimeoutMs) ||
handshakeTimeoutMs <= 0 ||
handshakeTimeoutMs > MAX_TIMER_DELAY_MS
) {
throw new TypeError(`PiServer handshakeTimeoutMs must be an integer between 1 and ${MAX_TIMER_DELAY_MS}`);
}
return { maxFrameLength, handshakeTimeoutMs };
}
View on GitHub (pinned to 4af9d21d3b)
Solutions
- Set maxFrameLength to an integer between 1 and MAX_UINT32.
When it happens
Trigger: Thrown at packages/server/src/server.ts:385 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/3f9c1a21ec7b24ac.
Report an issue: GitHub.