{"record":{"id":"fa6be974d12720bb","repo":"toeverything/AFFiNE","slug":"no-notion-markdown-or-html-pages-found-in-the-arch","errorCode":null,"errorMessage":"No Notion Markdown or HTML pages found in the archive","messagePattern":"No Notion Markdown or HTML pages found in the archive","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/modules/import/services/service.ts","lineNumber":181,"sourceCode":"      tagService: options.tag ? this.tagService : undefined,\n      logger,\n    });\n  }\n}\n\nasync function detectNotionZipFormat(file: File): Promise<'markdown' | 'html'> {\n  const unzip = new Unzip();\n  await unzip.load(file);\n  let hasHtml = false;\n  for (const entry of unzip) {\n    const lower = entry.path.toLowerCase();\n    if (lower.endsWith('.md')) return 'markdown';\n    if (lower.endsWith('.html') && !lower.endsWith('/index.html')) {\n      hasHtml = true;\n    }\n  }\n  if (hasHtml) return 'html';\n  throw new Error('No Notion Markdown or HTML pages found in the archive');\n}\n\nasync function snapshotReadableFiles(files: File[]) {\n  const snapshots: File[] = [];\n  const warnings: ImportWarning[] = [];\n  for (const file of files) {\n    try {\n      snapshots.push(await snapshotFile(file));\n    } catch (error) {\n      const sourcePath = file.webkitRelativePath || file.name;\n      const reason = error instanceof Error ? error.message : String(error);\n      warnings.push({\n        code: 'file-unreadable',\n        message: `Skipped unreadable file: ${sourcePath}. ${reason}`,\n        sourcePath,\n      });\n    }\n  }","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/modules/import/services/service.ts#L163-L199","documentation":"A format-detection failure in detectNotionZipFormat: the helper scanned every entry of the uploaded Notion export zip looking for '.md' pages (returns 'markdown') or '.html' pages (returns 'html', ignoring trailing /index.html). It fires when the archive contains neither — meaning the zip is not a Notion export (or is corrupted/empty), so the importer cannot pick a transformer for it.","triggerScenarios":"Thrown by detectNotionZipFormat when scanning the uploaded Notion export zip finds no .md files and no qualifying .html page files, so neither markdown nor html format can be detected.","commonSituations":"The uploaded Notion export archive contains no importable Markdown or HTML pages, e.g. a wrong or empty zip. Re-export from Notion with Markdown & CSV or HTML format and upload the correct archive.","solutions":["Export from Notion as Markdown or HTML and import that archive.","Check the archive contains the exported pages."],"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"}