{"record":{"id":"f10eeb3b40f44a67","repo":"toeverything/AFFiNE","slug":"this-import-has-too-many-documents-for-the-web-app","errorCode":null,"errorMessage":"This import has too many documents for the web app. Please import it in the desktop client.","messagePattern":"This import has too many documents 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":45,"sourceCode":") {\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    );\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    }","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/desktop/dialogs/import/web-limits.ts#L27-L63","documentation":"WebImportLimitError from preflightWebZipImport when the number of entries recognized as importable documents exceeds maxDocumentCount. Preflight guard keeping web imports within supported document limits.","triggerScenarios":"Thrown by preflightWebZipImport or preflightWebFilesImport when the number of importable documents (.md/.html/.htm) exceeds webImportLimits.maxDocumentCount (250).","commonSituations":"Hit when importing more than 250 Markdown/HTML documents at once in the web app. Import in smaller batches or use the desktop client.","solutions":["Use the desktop client for large document counts.","Split the archive into multiple smaller imports."],"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"}