{"record":{"id":"cf8c70f3087ed8f8","repo":"can1357/oh-my-pi","slug":"lzh-member-memberpath-uses-unsupported-compre","errorCode":null,"errorMessage":"LZH member '${memberPath}' uses unsupported compression method ${this.#method}","messagePattern":"LZH member '(.+?)' uses unsupported compression method (.+?)","errorType":"exception","errorClass":"ArchiveError","httpStatus":null,"severity":"error","filePath":"packages/utils/src/ar/lzh.ts","lineNumber":439,"sourceCode":"\t\t\tcase \"-lh4-\":\n\t\t\t\toutput = decompressLhStatic(packed, size, 1 << 12, 4, 13, \"LZH -lh4-\");\n\t\t\t\tbreak;\n\t\t\tcase \"-lh5-\":\n\t\t\t\toutput = decompressLhStatic(packed, size, 1 << 13, 4, 14, \"LZH -lh5-\");\n\t\t\t\tbreak;\n\t\t\tcase \"-lh6-\":\n\t\t\t\toutput = decompressLhStatic(packed, size, 1 << 15, 5, 16, \"LZH -lh6-\");\n\t\t\t\tbreak;\n\t\t\tcase \"-lh7-\":\n\t\t\t\toutput = decompressLhStatic(packed, size, 1 << 16, 5, 17, \"LZH -lh7-\");\n\t\t\t\tbreak;\n\t\t\tcase \"-lzs-\":\n\t\t\t\toutput = decompressLzs(packed, size);\n\t\t\t\tbreak;\n\t\t\tcase \"-lh1-\":\n\t\t\t\tthrow new ArchiveError(`LZH member '${memberPath}' uses unsupported dynamic-Huffman method -lh1-`);\n\t\t\tdefault:\n\t\t\t\tthrow new ArchiveError(`LZH member '${memberPath}' uses unsupported compression method ${this.#method}`);\n\t\t}\n\t\tif (output.byteLength !== size)\n\t\t\tthrow new ArchiveError(`LZH member '${memberPath}' extracted to an unexpected size`);\n\t\tif (crc16Arc(output) !== this.#crc)\n\t\t\tthrow new ArchiveError(`LZH member '${memberPath}' failed CRC-16 verification`);\n\t\treturn output;\n\t}\n}\n\ninterface ParsedLzhHeader {\n\tmethod: string;\n\tpackedSize: number;\n\tsize: number;\n\tdataStart: number;\n\tnextOffset: number;\n\tcrc: number;\n\tpath?: string;\n\tmtimeMs?: number;","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/utils/src/ar/lzh.ts#L421-L457","documentation":"The member's method string passed the format sniff regex (-lh0..7d, -lz4/5s) but is not one of the methods the decoder implements (lh0/4/5/6/7, lz4, lzs). Rather than attempting unknown decompression, the reader rejects the member with its method name in the message.","triggerScenarios":"Reading a member compressed with a recognized-but-unimplemented method such as -lh2-, -lh3-, -lz5-, -lhd- data misparse, or any method string matching the pattern that falls through the switch — e.g. -lh2-/-lh3- legacy dynamic Huffman, -lz5-.","commonSituations":"Archives created by rare/legacy LHA variants using -lh2-/-lh3-/-lz5-; archives whose header bytes were corrupted into a valid-looking but wrong method string; LHARK or other variant files.","solutions":["Recompress the archive with a modern compressor to -lh5-/-lh6-/-lh7- (e.g. `lha a -lh5`) before reading","Extract the affected members with an external tool (lhasa, 7-Zip) and process the extracted output instead","Check for archive corruption: an unexpected method on an otherwise valid archive often means header bytes were damaged","If you control archive creation, restrict writers to -lh0-/-lh5-..-lh7- methods this library supports"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// Only these methods are decodable by this library\nconst SUPPORTED = new Set([\"-lh0-\",\"-lh4-\",\"-lh5-\",\"-lh6-\",\"-lh7-\",\"-lz4-\",\"-lzs-\"]);\nfunction isSupportedMethod(method: string): boolean {\n\treturn SUPPORTED.has(method);\n}","typeGuard":"function isSupportedLzhMethod(m: string): m is \"-lh0-\" | \"-lh4-\" | \"-lh5-\" | \"-lh6-\" | \"-lh7-\" | \"-lz4-\" | \"-lzs-\" {\n\treturn [\"-lh0-\",\"-lh4-\",\"-lh5-\",\"-lh6-\",\"-lh7-\",\"-lz4-\",\"-lzs-\"].includes(m);\n}","tryCatchPattern":"try {\n\tconst data = await member.read();\n} catch (err) {\n\tif (err instanceof ArchiveError && /unsupported compression method/.test(err.message)) {\n\t\t// extract this member via an external tool or repack the archive\n\t}\n\tthrow err;\n}","preventionTips":["Recompress rare-method archives (-lh2-/-lh3-/-lz5-) with modern tooling before reading","Treat unexpected method strings on known archives as corruption signals","Standardize on -lh5-/-lh6-/-lh7- when producing LZH archives"],"tags":["archive","lzh","unsupported-compression","legacy-format"],"backgroundTag":"unsupported-compression-method","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}