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/transports/unix/listener.ts:413

}

function isErrorCode(error: unknown, code: string): boolean {
	return error instanceof Error && "code" in error && error.code === code;
}

export function createUnixListener(options: UnixListenerOptions): PiServerListener {
	return new UnixListener(options);
}

function resolveUnixListenerOptions(options: UnixListenerOptions): ResolvedUnixListenerOptions {
	validateUnixSocketPath(options.path, "PiServer Unix socket path");
	const mode = options.mode ?? DEFAULT_SOCKET_MODE;
	if (!Number.isInteger(mode) || mode < 0 || mode > 0o777) {
		throw new TypeError("PiServer Unix socket mode must be an integer between 0 and 0o777");
	}
	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 maxPendingBytes = options.maxPendingBytes ?? maxFrameLength * 4;
	if (!Number.isSafeInteger(maxPendingBytes) || maxPendingBytes < maxFrameLength + 4) {
		throw new TypeError("PiServer maxPendingBytes must be a safe integer at least maxFrameLength + 4");
	}
	const gracefulCloseTimeoutMs = options.gracefulCloseTimeoutMs ?? DEFAULT_GRACEFUL_CLOSE_TIMEOUT_MS;
	if (
		!Number.isSafeInteger(gracefulCloseTimeoutMs) ||
		gracefulCloseTimeoutMs <= 0 ||
		gracefulCloseTimeoutMs > MAX_TIMER_DELAY_MS
	) {
		throw new TypeError(`PiServer gracefulCloseTimeoutMs must be an integer between 1 and ${MAX_TIMER_DELAY_MS}`);
	}
	return {
		path: options.path,
		mode,
		maxPendingBytes,
		gracefulCloseTimeoutMs,

View on GitHub (pinned to 4af9d21d3b)

Solutions

  1. Set maxFrameLength to an integer between 1 and MAX_UINT32.

When it happens

Trigger: Thrown at packages/server/src/transports/unix/listener.ts:413 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/53aa281eab0447d3. Report an issue: GitHub.