{"record":{"id":"613429b66ebf9618","repo":"toeverything/AFFiNE","slug":"this-import-is-too-large-for-the-web-app-please-i","errorCode":null,"errorMessage":"This import is too large for the web app. Please import it in the desktop client.","messagePattern":"This import 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":29,"sourceCode":"  maxEntryBytes: 8 * 1024 * 1024,\n  maxEntryCount: 1000,\n  maxNestedZipDepth: 0,\n  maxDocumentCount: 250,\n};\n\nexport class WebImportLimitError extends Error {\n  constructor(message: string) {\n    super(message);\n    this.name = 'WebImportLimitError';\n  }\n}\n\nexport async function preflightWebZipImport(\n  file: File,\n  limits = webImportLimits\n) {\n  if (file.size > limits.maxTotalBytes) {\n    throw new WebImportLimitError(\n      'This import is too large for the web app. Please import it in the desktop client.'\n    );\n  }\n\n  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    );","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/desktop/dialogs/import/web-limits.ts#L11-L47","documentation":"WebImportLimitError from preflightWebZipImport when the zip file's total byte size exceeds maxTotalBytes. A preflight guard that rejects oversized imports in the browser, directing the user to the desktop client.","triggerScenarios":"Thrown by preflightWebZipImport or preflightWebFilesImport when the total import size exceeds webImportLimits.maxTotalBytes (32 MiB).","commonSituations":"Users hit this importing a large zip or folder in the web app. Split the import or use the desktop client, which has no such cap.","solutions":["Run the import in the AFFiNE desktop client instead of the web app.","Split the import into smaller archives."],"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-14T05:17:10.506Z"}