{"record":{"id":"ca140223fbce001c","repo":"microsoft/typescript-go","slug":"expected-binary-data-0xc4-0xc6-received-0x-ma","errorCode":null,"errorMessage":"Expected binary data (0xc4-0xc6), received: 0x${marker.toString(16)}","messagePattern":"Expected binary data \\(0xc4-0xc6\\), received: 0x(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"_packages/native-preview/src/api/syncChannel.ts","lineNumber":488,"sourceCode":"     * Read a MessagePack bin field.\r\n     */\r\n    private readBin(): Buffer {\r\n        const marker = this.readByte();\r\n        let size: number;\r\n        switch (marker) {\r\n            case MSGPACK_BIN8:\r\n                size = this.readByte();\r\n                break;\r\n            case MSGPACK_BIN16:\r\n                this.readExactInto(this.headerBuf, 2);\r\n                size = (this.headerBuf[0] << 8) | this.headerBuf[1];\r\n                break;\r\n            case MSGPACK_BIN32:\r\n                this.readExactInto(this.headerBuf, 4);\r\n                size = this.headerBuf.readUInt32BE(0);\r\n                break;\r\n            default:\r\n                throw new Error(\r\n                    `Expected binary data (0xc4-0xc6), received: 0x${marker.toString(16)}`,\r\n                );\r\n        }\r\n        if (size === 0) return EMPTY_BUF;\r\n        return this.readExact(size);\r\n    }\r\n\r\n    // ── Low-level synchronous I/O ───────────────────────────────────\r\n\r\n    /** Build an EOF error with the child's exit code/signal if available. */\r\n    private eofError(): Error {\r\n        const code = this.child.exitCode;\r\n        const signal = this.child.signalCode;\r\n        const detail = signal ? `killed by signal ${signal}` : code !== null ? `exited with code ${code}` : \"unknown reason\";\r\n        return new Error(`Unexpected EOF while reading from child process (${detail})`);\r\n    }\r\n\r\n    /** Read a single byte from the buffered read-ahead. */\r","sourceCodeStart":470,"sourceCodeEnd":506,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/_packages/native-preview/src/api/syncChannel.ts#L470-L506","documentation":"While reading the name or payload field, the parser expected a MessagePack bin marker (0xc4 bin8, 0xc5 bin16, 0xc6 bin32) but found another byte. The framing is misaligned or the peer encoded strings instead of raw bytes.","triggerScenarios":"Desynchronized stream (same root cause as errors 83/84), or a child/hand-written peer that encodes the name/payload with str markers (0xa*/0xd*) instead of bin markers.","commonSituations":"Custom MessagePack encoders using 'str' for names; stdout pollution from the child; partial frame followed by EOF-ish garbage after a crash.","solutions":["Verify the peer writes bin8/bin16/bin32 for name and payload fields","Remove any non-protocol stdout writes from the child","Restart the channel after a corruption — alignment is unrecoverable","Match package and child binary versions"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { /* channel request */ } catch (e) { if (/Expected binary data/.test(e.message)) { /* framing lost: restart the channel session */ } throw e; }","preventionTips":["Encode name/payload strictly as MessagePack bin (0xc4-0xc6)","Use the provided writeTuple/readTuple helpers; never hand-roll frames","Restart on corruption — realignment is not supported"],"tags":["rpc","messagepack","protocol-corruption","encoding"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}