{"record":{"id":"40b016e5242ce94a","repo":"paperclipai/paperclip","slug":"unsupported-zip-archive-this-browser-cannot-read","errorCode":null,"errorMessage":"Unsupported zip archive: this browser cannot read compressed zip entries.","messagePattern":"Unsupported zip archive: this browser cannot read compressed zip entries\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ui/src/lib/zip.ts","lineNumber":173,"sourceCode":"  const text = decodeStrictUtf8(bytes);\n  if (text !== null) return text;\n  // Bytes that are not valid UTF-8 must not be decoded lossily; fall back\n  // to base64 so they round-trip exactly.\n  return { encoding: \"base64\", data: bytesToBase64(bytes), contentType: \"application/octet-stream\" };\n}\n\nfunction portableFileEntryToBytes(entry: CompanyPortabilityFileEntry): Uint8Array {\n  if (typeof entry === \"string\") return textEncoder.encode(entry);\n  return base64ToBytes(entry.data);\n}\n\nasync function inflateZipEntry(compressionMethod: number, bytes: Uint8Array) {\n  if (compressionMethod === 0) return bytes;\n  if (compressionMethod !== 8) {\n    throw new Error(\"Unsupported zip archive: only STORE and DEFLATE entries are supported.\");\n  }\n  if (typeof DecompressionStream !== \"function\") {\n    throw new Error(\"Unsupported zip archive: this browser cannot read compressed zip entries.\");\n  }\n  const body = new Uint8Array(bytes.byteLength);\n  body.set(bytes);\n  const stream = new Blob([body]).stream().pipeThrough(new DecompressionStream(\"deflate-raw\"));\n  return new Uint8Array(await new Response(stream).arrayBuffer());\n}\n\nexport async function readZipArchive(source: ArrayBuffer | Uint8Array): Promise<{\n  rootPath: string | null;\n  files: Record<string, CompanyPortabilityFileEntry>;\n}> {\n  const bytes = source instanceof Uint8Array ? source : new Uint8Array(source);\n  const entries: Array<{ path: string; body: CompanyPortabilityFileEntry }> = [];\n  let offset = 0;\n\n  while (offset + 4 <= bytes.length) {\n    const signature = readUint32(bytes, offset);\n    if (signature === 0x02014b50 || signature === 0x06054b50) break;","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/ui/src/lib/zip.ts#L155-L191","documentation":"Browser zip reader environment check: DeflateStream/DecompressionStream('deflate-raw') is unavailable in this browser, so compressed (DEFLATE) entries cannot be inflated. The user should use a modern browser; the archive itself is fine — only the runtime lacks decompression support.","triggerScenarios":"Thrown at ui/src/lib/zip.ts:173 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a browser that supports DecompressionStream (modern Chrome/Edge/Firefox), or upload an uncompressed (STORE) zip."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}