{"record":{"id":"98a3c823805e6946","repo":"can1357/oh-my-pi","slug":"arj-member-memberpath-uses-unsupported-compre","errorCode":null,"errorMessage":"ARJ member '${memberPath}' uses unsupported compression method ${this.#method}","messagePattern":"ARJ member '(.+?)' uses unsupported compression method (.+?)","errorType":"exception","errorClass":"ArchiveError","httpStatus":null,"severity":"error","filePath":"packages/utils/src/ar/arj.ts","lineNumber":198,"sourceCode":"\t\t\t\toutput = packed.slice();\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\tcase 3:\n\t\t\t\toutput = decompressLhStatic(packed, size, 26_624, 5, 17, `ARJ method ${this.#method}`);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\toutput = decompressArjMethod4(packed, size);\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\tcase 9:\n\t\t\t\tif (size !== 0 || packed.byteLength !== 0) {\n\t\t\t\t\tthrow new ArchiveError(`ARJ member '${memberPath}' has invalid no-data method sizes`);\n\t\t\t\t}\n\t\t\t\toutput = new Uint8Array(0);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new ArchiveError(`ARJ member '${memberPath}' uses unsupported compression method ${this.#method}`);\n\t\t}\n\t\tif (output.byteLength !== size)\n\t\t\tthrow new ArchiveError(`ARJ member '${memberPath}' extracted to an unexpected size`);\n\t\tif (this.#method !== 8 && crc32(output) !== this.#crc) {\n\t\t\tthrow new ArchiveError(`ARJ member '${memberPath}' failed CRC32 verification`);\n\t\t}\n\t\treturn output;\n\t}\n}\n\nfunction normalizeHostPath(rawPath: string, hostOs: number): string {\n\tlet path = rawPath.replaceAll(\"\\\\\", \"/\");\n\tif (hostOs === 1) path = path.replaceAll(\">\", \"/\");\n\telse if (hostOs === 4) path = path.replaceAll(\":\", \"/\");\n\treturn path;\n}\n\n/** Probe whether bytes begin with a CRC-framed ARJ main header. */","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/utils/src/ar/arj.ts#L180-L216","documentation":"This ArchiveError is thrown when an ARJ member declares a compression method outside the supported set (0–4, 8, 9), e.g. newer ARJ methods this reader does not implement. The library intentionally fails fast instead of producing garbage output.","triggerScenarios":"Calling member.read(size, memberPath) on an ARJ member whose local header method byte (offset bodyStart+5) is 5, 6, 7, or any value other than 0–4 and 8–9.","commonSituations":"Archives created with ARJ compression modes this library does not support (higher/experimental methods), archives from newer archiver versions, or corrupted method bytes.","solutions":["Recreate the archive using a supported ARJ method (0 stored, 1–3 LH static, 4 fast LZSS, or 8/9 no-data).","Check the archiver version that produced the file and export with maximum compatibility settings (method 1 or 4).","Catch ArchiveError and report/skip unsupported members, listing which memberPath uses which method.","Extend or upgrade the library if support for the new method is required."],"exampleFix":"// before\nconst data = await member.read(member.size, member.path);\n// after\ntry {\n  const data = await member.read(member.size, member.path);\n} catch (e) {\n  if (e instanceof ArchiveError && /unsupported compression method/.test(e.message)) {\n    console.warn(`unsupported ARJ method for ${member.path}; re-pack archive with method 1-4`);\n    return null;\n  }\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"const SUPPORTED = new Set([0, 1, 2, 3, 4, 8, 9]);\nif (!SUPPORTED.has(member.method)) {\n  throw new Error(`member ${member.path} uses unsupported ARJ method ${member.method}; re-pack the archive`);\n}","typeGuard":"function hasSupportedArjMethod(m: { method: number }): boolean {\n  return [0, 1, 2, 3, 4, 8, 9].includes(m.method);\n}","tryCatchPattern":"try {\n  const data = await member.read(size, path);\n} catch (e) {\n  if (e instanceof ArchiveError && /unsupported compression method/.test(e.message)) {\n    // surface which member/method, skip or re-pack\n  } else throw e;\n}","preventionTips":["Inspect the method byte of each local header before extraction","Prefer archives created with method 1-4 for maximum compatibility","Catch and aggregate unsupported-member errors so one member does not abort a batch"],"tags":["archive","arj","unsupported-feature","compression"],"backgroundTag":"unsupported-compression-method","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}