{"record":{"id":"d9027f0e55890ef0","repo":"nexu-io/open-design","slug":"unsupported-zip-compression-method-method","errorCode":null,"errorMessage":"unsupported zip compression method: ${method}","messagePattern":"unsupported zip compression method: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":400,"severity":"error","filePath":"apps/daemon/src/design/claude-design-import.ts","lineNumber":209,"sourceCode":"\n  const entries: ZipEntry[] = [];\n  let offset = centralOffset;\n  for (let i = 0; i < entryCount; i += 1) {\n    if (zip.readUInt32LE(offset) !== CENTRAL_SIG) {\n      throw new Error('invalid zip central directory entry');\n    }\n    const flags = zip.readUInt16LE(offset + 8);\n    const method = zip.readUInt16LE(offset + 10);\n    const compressedSize = zip.readUInt32LE(offset + 20);\n    const uncompressedSize = zip.readUInt32LE(offset + 24);\n    const nameLen = zip.readUInt16LE(offset + 28);\n    const extraLen = zip.readUInt16LE(offset + 30);\n    const commentLen = zip.readUInt16LE(offset + 32);\n    const localOffset = zip.readUInt32LE(offset + 42);\n    const name = zip.slice(offset + 46, offset + 46 + nameLen).toString('utf8');\n    if ((flags & 1) !== 0) throw new Error('encrypted zip entries are not supported');\n    if (method !== 0 && method !== 8) {\n      throw new Error(`unsupported zip compression method: ${method}`);\n    }\n    entries.push({\n      name,\n      method,\n      compressedSize,\n      uncompressedSize,\n      localOffset,\n      isDirectory: name.endsWith('/'),\n    });\n    offset += 46 + nameLen + extraLen + commentLen;\n  }\n  return entries;\n}\n\nfunction findEndOfCentralDirectory(zip: Buffer): number {\n  const min = Math.max(0, zip.length - 0xffff - 22);\n  for (let i = zip.length - 22; i >= min; i -= 1) {\n    if (zip.readUInt32LE(i) === EOCD_SIG) return i;","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/design/claude-design-import.ts#L191-L227","documentation":"Only compression methods 0 (stored) and 8 (deflate) are accepted. Any other method (e.g. 12 Bzip2, 14 LZMA, 93 Zstandard, 95 XZ) throws with the numeric method. Maps to HTTP 400 via the /api/import/claude-design route.","triggerScenarios":"A zip entry compressed with a non-deflate codec. importClaudeDesignZip -> readCentralDirectory reads method = zip.readUInt16LE(offset + 10) and method !== 0 && method !== 8 fails.","commonSituations":"Modern zip tools defaulting to zstd or xz; 7-Zip using LZMA; a re-archiving step that chose a newer codec; Windows 'Compress to ZSTD' shell extensions.","solutions":["Recreate the zip using deflate (standard `zip` CLI, Finder 'Compress', or Windows 'Send to > Compressed (zipped) folder').","Avoid zstd/xz/bzip2/lzma codecs when archiving for import.","Verify with `unzip -lv file.zip` that the 'Method' column reads 'Stored' or 'Defl:N'."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Confirm every entry uses Stored or Deflate before importing.\nimport { execFileSync } from 'node:child_process';\nfunction zipUsesOnlyDeflate(file: string): boolean {\n  try {\n    const out = execFileSync('unzip', ['-lv', file], { encoding: 'utf8' });\n    // Method column must be 'Stored' or 'Defl:*' for every entry.\n    return !/\\b(Bzip2|LZMA|Zstandard|XZ|bz2|lzma|zst|xz)\\b/i.test(out);\n  } catch {\n    return false;\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await importClaudeDesignZip(zipPath, projectDir);\n} catch (err) {\n  if (String(err).includes('unsupported zip compression method')) {\n    return res.status(400).json({ error: 're-zip with deflate compression' });\n  }\n  throw err;\n}","preventionTips":["Standardize on Info-ZIP or Finder/Explorer to produce deflate zips.","Avoid zstd/xz/bzip2 defaults in 7-Zip and modern shell extensions.","Verify with `unzip -lv` that the Method column reads Defl/Stored."],"tags":["zip","compression","deflate","import","claude-design"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}