can1357/oh-my-pi · error · ArchiveError
Unsupported ZIP compression method ${this.#method} for '${me
Error message
Unsupported ZIP compression method ${this.#method} for '${memberPath}' What it means
Thrown when a ZIP member's central directory declares a compression method this reader does not implement (anything other than stored=0, deflate=8, or the same check treats 99 as encrypted first). The library only supports a fixed set of methods (SUPPORTED_METHODS), so exotic codecs like bzip2 (12), LZMA (14), or zstd (93) are rejected instead of producing garbage. It is an ArchiveError naming the offending member.
Source
Thrown at packages/utils/src/ar/zip.ts:396
limits: ArchiveLimits,
) {
this.#source = source;
this.#compressedSize = compressedSize;
this.#method = method;
this.#flags = flags;
this.#crc = crc;
this.#localHeaderOffset = localHeaderOffset;
this.#limits = limits;
}
async read(size: number, memberPath: string): Promise<Uint8Array> {
try {
assertArchiveMemberSize(Math.max(size, this.#compressedSize), memberPath, this.#limits);
if ((this.#flags & (ENCRYPTED_FLAG | STRONG_ENCRYPTION_FLAG)) !== 0 || this.#method === 99) {
throw new ArchiveError(`Encrypted ZIP member '${memberPath}' is not supported`);
}
if (SUPPORTED_METHODS[this.#method] !== true) {
throw new ArchiveError(`Unsupported ZIP compression method ${this.#method} for '${memberPath}'`);
}
const headerEnd = checkedEnd(
this.#localHeaderOffset,
30,
this.#source.size,
`local header for '${memberPath}'`,
);
const header = await this.#source.read(this.#localHeaderOffset, headerEnd);
if (header.byteLength !== 30 || readUInt32LE(header, 0) !== LOCAL_HEADER_SIGNATURE) {
throw new ArchiveError(`Invalid ZIP archive: malformed local header for '${memberPath}'`);
}
const localFlags = readUInt16LE(header, 6);
if ((localFlags & (ENCRYPTED_FLAG | STRONG_ENCRYPTION_FLAG)) !== 0) {
throw new ArchiveError(`Encrypted ZIP member '${memberPath}' is not supported`);
}
if (readUInt16LE(header, 8) !== this.#method) {
throw new ArchiveError(
`Invalid ZIP archive: local and central compression methods disagree for '${memberPath}'`,View on GitHub (pinned to 9690622007)
Solutions
- Recompress/re-save the ZIP with standard Deflate (e.g. `zip -r out.zip dir` or 7-Zip 'ZIP (deflate)') and retry
- Detect method 99: decrypt the archive yourself first — these zips are password-protected, not merely differently-compressed
- Inspect the member's method with `unzip -lv archive.zip` to confirm which codec was used
- If you control the producer, force deflate (`7z a -tzip -mm=Deflate`) rather than the tool's default
Example fix
// before (shell): archive compressed with zstd inside zip 7z a -tzip -mm=ZSTD out.zip dir/ // reader throws 3710 // after 7z a -tzip -mm=Deflate out.zip dir/
Defensive patterns
Strategy: validation
Validate before calling
// Peek the method from the central directory before extraction
// (or simply check with unzip -lv out.zip that methods are 'Stored'/'Deflated')
const SUPPORTED = new Set([0, 8]);
if (!SUPPORTED.has(entry.method)) throw new Error(`unsupported zip method ${entry.method}; recompress with deflate`); Try / catch
try {
const data = await zip.read(member);
} catch (err) {
if (err instanceof ArchiveError && /Unsupported ZIP compression method/.test(err.message)) {
// fall back to external tool: $`7z x -mm=Deflate archive.zip`
} else throw err;
} Prevention
- Prefer deflate when creating zips shared with this library
- Check `unzip -lv` output for 'bzip2'/'LZMA'/'zstd' methods before ingesting third-party archives
- Treat method 99 entries as encrypted and require a password upstream
- Document codec restrictions wherever archives are accepted as input
When it happens
Trigger: Calling a ZIP read/extract API (ZipMemberSource read path) on an archive whose central directory entry has method not in {0,8}; the same member also throws first if method===99 (AES) or encryption flags are set.
Common situations: Downloading archives produced by 7-Zip or Info-ZIP with bzip2/LZMA/zstd compression selected; AES-encrypted zips written by WinZip (method 99); zips created by tools defaulting to newer codecs; opening Java/Gradle wrappers or package archives compressed with non-deflate settings.
Related errors
- Unsupported ZIP compression method ${method} for '${memberPa
- RPM package '${identity}' uses unsupported payload compresso
- RPM package '${identity}' uses unsupported payload compresso
- Invalid ZIP archive: malformed local header for '${memberPat
- Invalid ZIP archive: local and central compression methods d
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/e2f642f65d3cc886.
Report an issue: GitHub.