{"record":{"id":"8f03270a40c8fff9","repo":"toeverything/AFFiNE","slug":"this-import-contains-a-file-that-is-too-large-for","errorCode":null,"errorMessage":"This import contains a file that is too large for the web app. Please import it in the desktop client.","messagePattern":"This import contains a file that is too large for the web app\\. Please import it in the desktop client\\.","errorType":"exception","errorClass":"WebImportLimitError","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/desktop/dialogs/import/web-limits.ts","lineNumber":52,"sourceCode":"  const entries = readZipDirectory(new Uint8Array(await file.arrayBuffer()));\n  if (entries.length > limits.maxEntryCount) {\n    throw new WebImportLimitError(\n      'This import has too many files for the web app. Please import it in the desktop client.'\n    );\n  }\n\n  const documentCount = entries.filter(entry =>\n    isWebImportDocument(entry.name)\n  ).length;\n  if (documentCount > limits.maxDocumentCount) {\n    throw new WebImportLimitError(\n      'This import has too many documents for the web app. Please import it in the desktop client.'\n    );\n  }\n\n  for (const entry of entries) {\n    if (entry.uncompressedSize > limits.maxEntryBytes) {\n      throw new WebImportLimitError(\n        'This import contains a file that is too large for the web app. Please import it in the desktop client.'\n      );\n    }\n    if (\n      limits.maxNestedZipDepth === 0 &&\n      entry.name.toLowerCase().endsWith('.zip')\n    ) {\n      throw new WebImportLimitError(\n        'This import contains a nested zip. Please import it in the desktop client.'\n      );\n    }\n  }\n}\n\nexport async function preflightWebFilesImport(\n  files: File[],\n  limits = webImportLimits\n) {","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/desktop/dialogs/import/web-limits.ts#L34-L70","documentation":"WebImportLimitError thrown during the per-entry loop of preflightWebZipImport when any single entry's uncompressed size exceeds maxEntryBytes. Preflight guard against individual oversized files in the web app.","triggerScenarios":"Thrown by preflightWebZipImport or preflightWebFilesImport when any single entry's size exceeds webImportLimits.maxEntryBytes (8 MiB).","commonSituations":"Occurs when one file in the import is larger than 8 MiB. Shrink or remove that file, or import in the desktop client.","solutions":["Import via the desktop client.","Remove or compress the oversized file inside the archive."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}