{"record":{"id":"68319453b3ff9449","repo":"toeverything/AFFiNE","slug":"expected-a-single-zip-file-for-notion-import","errorCode":null,"errorMessage":"Expected a single zip file for notion import","messagePattern":"Expected a single zip file for notion import","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/desktop/dialogs/import/index.tsx","lineNumber":347,"sourceCode":"          collection: docCollection,\n          schema: getAFFiNEWorkspaceSchema(),\n          extensions: getStoreManager().config.init().value.get('store'),\n          html: text,\n          fileName,\n        });\n        if (docId) docIds.push(docId);\n      }\n      return {\n        docIds,\n      };\n    },\n  },\n  notion: {\n    fileOptions: { acceptType: 'Zip', multiple: false },\n    importFunction: async ({ files, importService, context }) => {\n      const file = files.length === 1 ? files[0] : null;\n      if (!file) {\n        throw new Error('Expected a single zip file for notion import');\n      }\n      return requireImportService(importService).importNotionZip(file, context);\n    },\n  },\n  obsidian: {\n    fileOptions: { acceptType: 'Directory', multiple: false },\n    importFunction: async ({ files, importService, context }) => {\n      return requireImportService(importService).importObsidianVault(\n        files,\n        context\n      );\n    },\n  },\n  bear: {\n    fileOptions: { acceptType: 'Zip', multiple: false },\n    importFunction: async ({ files, importService, context }) => {\n      const file = files.length === 1 ? files[0] : null;\n      if (!file) {","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/desktop/dialogs/import/index.tsx#L329-L365","documentation":"An input-count guard in the Notion import dialog: the fileOptions for Notion declare a single Zip file (multiple: false), and the importFunction requires exactly one selected file. It fires when files.length is not 1 (zero or multiple files reached the importer), which normally indicates the file picker options were bypassed or misconfigured.","triggerScenarios":"Thrown by the Notion import function when files.length is not exactly one, since Notion import requires a single exported zip archive.","commonSituations":"The Notion import was started without choosing exactly one zip export. Export the workspace from Notion as a zip and select that single file.","solutions":["Select exactly one zip file exported from Notion.","Re-pick the file in the import dialog."],"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"}