{"record":{"id":"547df3a277978291","repo":"toeverything/AFFiNE","slug":"expected-a-single-bear2bk-file-for-bear-import","errorCode":null,"errorMessage":"Expected a single .bear2bk file for Bear import","messagePattern":"Expected a single \\.bear2bk file for Bear import","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/desktop/dialogs/import/index.tsx","lineNumber":366,"sourceCode":"      }\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) {\n        throw new Error('Expected a single .bear2bk file for Bear import');\n      }\n      return requireImportService(importService).importBearBackup(\n        file,\n        context\n      );\n    },\n  },\n  oneNote: {\n    fileOptions: { acceptType: 'OneNote', multiple: false },\n    nativeOnly: true,\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 OneNote file');\n      }\n      return requireImportService(importService).importOneNote(file, context);\n    },\n  },","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/desktop/dialogs/import/index.tsx#L348-L384","documentation":"Guard in the Bear import config: the file picker must yield exactly one .bear2bk backup archive; any other count (zero, or multiple) means no usable Bear backup was selected, so the import cannot proceed and the config throws before calling importBearBackup.","triggerScenarios":"Thrown by the Bear import function when the selection does not contain exactly one .bear2bk backup file.","commonSituations":"The user picked no file or several files for a Bear import. Export a .bear2bk backup from Bear and choose that single file.","solutions":["Select a single .bear2bk backup file.","Re-export from Bear if the file is missing."],"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"}