earendil-works/pi · error · Error

Unix transport is not supported on Windows

Error message

Unix transport is not supported on Windows

What it means

Error "Unix transport is not supported on Windows" thrown in earendil-works/pi.

Source

Thrown at packages/client/src/unix.ts:22

const MAX_UNIX_SOCKET_PATH_BYTES = process.platform === "linux" ? 107 : 103;

export interface UnixTransportOptions {
	path: string;
	maxPendingBytes?: number;
}

/** Creates fresh Unix-domain socket transports for PiClient connection attempts in Node-compatible runtimes. */
export function createUnixTransportFactory(options: UnixTransportOptions): ByteTransportFactory {
	if (options.path.length === 0) throw new TypeError("Unix transport path must not be empty");
	if (Buffer.byteLength(options.path) > MAX_UNIX_SOCKET_PATH_BYTES) {
		throw new TypeError(`Unix transport path is too long; maximum is ${MAX_UNIX_SOCKET_PATH_BYTES} UTF-8 bytes`);
	}
	const maxPendingBytes = options.maxPendingBytes ?? DEFAULT_MAX_FRAME_LENGTH * 4;
	if (!Number.isSafeInteger(maxPendingBytes) || maxPendingBytes <= 0) {
		throw new TypeError("Unix transport maxPendingBytes must be a positive safe integer");
	}
	if (process.platform === "win32") throw new Error("Unix transport is not supported on Windows");
	return (handlers) => connectUnixSocket(options.path, maxPendingBytes, handlers);
}

function connectUnixSocket(
	path: string,
	maxPendingBytes: number,
	handlers: ByteTransportHandlers,
): Promise<ByteTransport> {
	return new Promise<ByteTransport>((resolve, reject) => {
		const socket = createConnection(path);
		let connected = false;
		let terminal = false;

		const close = (): void => {
			if (terminal) return;
			terminal = true;
			socket.destroy();
			if (connected) handlers.onClose();

View on GitHub (pinned to 4af9d21d3b)

When it happens

Trigger: Thrown at packages/client/src/unix.ts:22 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/ab224fcb429c050d. Report an issue: GitHub.