{"record":{"id":"a02ea890a6ba429d","repo":"microsoft/typescript-go","slug":"expected-fixed-3-element-array-0x93-received-0","errorCode":null,"errorMessage":"Expected fixed 3-element array (0x93), received: 0x${marker.toString(16)}","messagePattern":"Expected fixed 3-element array \\(0x93\\), received: 0x(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"_packages/native-preview/src/api/syncChannel.ts","lineNumber":446,"sourceCode":"                else {\r\n                    this.writeAllBuf(payload as Buffer | Uint8Array);\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    // ── MessagePack tuple read ──────────────────────────────────────\r\n\r\n    /**\r\n     * Read a [type, name, payload] tuple into instance fields\r\n     * (_msgType, _msgName, _msgPayload) to avoid allocating a\r\n     * short-lived 3-element array on every call.\r\n     */\r\n    private readTuple(): void {\r\n        // Fixed 3-element array marker\r\n        const marker = this.readByte();\r\n        if (marker !== MSGPACK_FIXARRAY3) {\r\n            throw new Error(\r\n                `Expected fixed 3-element array (0x93), received: 0x${marker.toString(16)}`,\r\n            );\r\n        }\r\n\r\n        // Message type – positive fixint or uint8\r\n        const tb = this.readByte();\r\n        if (tb <= 0x7f) {\r\n            this._msgType = tb;\r\n        }\r\n        else if (tb === MSGPACK_UINT8) {\r\n            this._msgType = this.readByte();\r\n        }\r\n        else {\r\n            throw new Error(\r\n                `Expected positive fixint or uint8 marker, received: 0x${tb.toString(16)}`,\r\n            );\r\n        }\r\n\r","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/_packages/native-preview/src/api/syncChannel.ts#L428-L464","documentation":"The first byte of an expected [type, name, payload] tuple is not the MessagePack fixarray-3 marker (0x93). The parent and child have lost byte-stream alignment, so the channel can no longer parse frames.","triggerScenarios":"Anything corrupting or shifting the child's stdout: stray writes from the child (fmt.Println/debug prints on stdout instead of stderr), interleaved output from grandchild processes, a truncated message from a crashed child, or a partial read followed by a misaligned resume.","commonSituations":"Building a custom Go child and accidentally printing logs to stdout; piping the child through a tool that mangles bytes; version/protocol drift changing the frame layout; reading the channel after the child died mid-write.","solutions":["Ensure the child writes NOTHING to stdout except protocol frames (send logs to stderr)","Restart the session — the channel cannot resynchronize; catch the error, kill the child, and respawn","Rebuild/reinstall so host and child run the same protocol version","If you maintain the child, run its output through the same MessagePack writer on every write path"],"exampleFix":"// before (Go child)\nfmt.Println(\"debug info\") // corrupts the stdout frame stream\n\n// after\nfmt.Fprintln(os.Stderr, \"debug info\")","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { channel.readResponse(); } catch (e) { if (e.message.includes('0x93')) { /* stream corrupted: kill child, spawn fresh session, retry request once */ } throw e; }","preventionTips":["Route ALL child diagnostics to stderr","Never share the child's stdout with other readers","Catch framing errors at the session boundary and restart rather than resync"],"tags":["rpc","messagepack","protocol-corruption","native-preview"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}