{"record":{"id":"a00a75849988e05a","repo":"earendil-works/pi","slug":"piclient-maxframelength-must-be-an-integer-between","errorCode":null,"errorMessage":"PiClient maxFrameLength must be an integer between 1 and 4294967295","messagePattern":"PiClient maxFrameLength must be an integer between 1 and 4294967295","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/client/src/connection.ts","lineNumber":54,"sourceCode":"\tonMessage(message: Exclude<ServerMessage, { type: \"hello\" | \"hello_error\" }>): void;\n\tonStateChange(change: ConnectionStateChange): void;\n}\n\nexport class Connection {\n\treadonly #options: ConnectionOptions;\n\treadonly #maxFrameLength: number;\n\t#lifecycle: ConnectionLifecycle = { state: \"disconnected\" };\n\t#sequence = 0;\n\n\tconstructor(options: ConnectionOptions) {\n\t\tthis.#options = options;\n\t\tthis.#maxFrameLength = options.maxFrameLength ?? DEFAULT_MAX_FRAME_LENGTH;\n\t\tif (\n\t\t\t!Number.isSafeInteger(this.#maxFrameLength) ||\n\t\t\tthis.#maxFrameLength <= 0 ||\n\t\t\tthis.#maxFrameLength > MAX_UINT32\n\t\t) {\n\t\t\tthrow new TypeError(`PiClient maxFrameLength must be an integer between 1 and ${MAX_UINT32}`);\n\t\t}\n\t}\n\n\tget state(): ConnectionState {\n\t\treturn this.#lifecycle.state;\n\t}\n\n\tget maxFrameLength(): number {\n\t\treturn this.#maxFrameLength;\n\t}\n\n\tconnect(): Promise<ServerSnapshot> {\n\t\tif (this.#lifecycle.state !== \"disconnected\") {\n\t\t\treturn Promise.reject(new PiDisconnectedError(`PiClient is already ${this.#lifecycle.state}`));\n\t\t}\n\t\tconst id = ++this.#sequence;\n\t\tconst handshake = createPromiseResolvers<ServerSnapshot>();\n\t\tthis.#lifecycle = {","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/client/src/connection.ts#L36-L72","documentation":"Error \"PiClient maxFrameLength must be an integer between 1 and 4294967295\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/client/src/connection.ts:54 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set maxFrameLength to an integer between 1 and 4294967295."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}