can1357/oh-my-pi · error · ArchiveError
ARJ member ' ' uses unsupported compression method
Error message
ARJ member '${memberPath}' uses unsupported compression method ${this.#method} What it means
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.
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.
Example fix
// before
const data = await member.read(member.size, member.path);
// after
try {
const data = await member.read(member.size, member.path);
} catch (e) {
if (e instanceof ArchiveError && /unsupported compression method/.test(e.message)) {
console.warn(`unsupported ARJ method for ${member.path}; re-pack archive with method 1-4`);
return null;
}
throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
const SUPPORTED = new Set([0, 1, 2, 3, 4, 8, 9]);
if (!SUPPORTED.has(member.method)) {
throw new Error(`member ${member.path} uses unsupported ARJ method ${member.method}; re-pack the archive`);
} Type guard
function hasSupportedArjMethod(m: { method: number }): boolean {
return [0, 1, 2, 3, 4, 8, 9].includes(m.method);
} Try / catch
try {
const data = await member.read(size, path);
} catch (e) {
if (e instanceof ArchiveError && /unsupported compression method/.test(e.message)) {
// surface which member/method, skip or re-pack
} else throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Archives created with ARJ compression modes this library does not support (higher/experimental methods), archives from newer archiver versions, or corrupted method bytes.
Related errors
- Encrypted ARJ archives are unsupported
- Encrypted ARJ members are unsupported
- Multi-volume ARJ archives are unsupported
- Multi-volume ARJ members are unsupported
- Archive member ' ' is a sparse file and cannot be read
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/98a3c823805e6946.
Report an issue: GitHub.
Appendix: source
Thrown at packages/utils/src/ar/arj.ts:198
output = packed.slice();
break;
case 1:
case 2:
case 3:
output = decompressLhStatic(packed, size, 26_624, 5, 17, `ARJ method ${this.#method}`);
break;
case 4:
output = decompressArjMethod4(packed, size);
break;
case 8:
case 9:
if (size !== 0 || packed.byteLength !== 0) {
throw new ArchiveError(`ARJ member '${memberPath}' has invalid no-data method sizes`);
}
output = new Uint8Array(0);
break;
default:
throw new ArchiveError(`ARJ member '${memberPath}' uses unsupported compression method ${this.#method}`);
}
if (output.byteLength !== size)
throw new ArchiveError(`ARJ member '${memberPath}' extracted to an unexpected size`);
if (this.#method !== 8 && crc32(output) !== this.#crc) {
throw new ArchiveError(`ARJ member '${memberPath}' failed CRC32 verification`);
}
return output;
}
}
function normalizeHostPath(rawPath: string, hostOs: number): string {
let path = rawPath.replaceAll("\\", "/");
if (hostOs === 1) path = path.replaceAll(">", "/");
else if (hostOs === 4) path = path.replaceAll(":", "/");
return path;
}
/** Probe whether bytes begin with a CRC-framed ARJ main header. */View on GitHub (pinned to 9690622007)