toeverything/AFFiNE · error · Error

Expected a single .bear2bk file for Bear import

Error message

Expected a single .bear2bk file for Bear import

What it means

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.

Source

Thrown at packages/frontend/core/src/desktop/dialogs/import/index.tsx:366

      }
      return requireImportService(importService).importNotionZip(file, context);
    },
  },
  obsidian: {
    fileOptions: { acceptType: 'Directory', multiple: false },
    importFunction: async ({ files, importService, context }) => {
      return requireImportService(importService).importObsidianVault(
        files,
        context
      );
    },
  },
  bear: {
    fileOptions: { acceptType: 'Zip', multiple: false },
    importFunction: async ({ files, importService, context }) => {
      const file = files.length === 1 ? files[0] : null;
      if (!file) {
        throw new Error('Expected a single .bear2bk file for Bear import');
      }
      return requireImportService(importService).importBearBackup(
        file,
        context
      );
    },
  },
  oneNote: {
    fileOptions: { acceptType: 'OneNote', multiple: false },
    nativeOnly: true,
    importFunction: async ({ files, importService, context }) => {
      const file = files.length === 1 ? files[0] : null;
      if (!file) {
        throw new Error('Expected a single OneNote file');
      }
      return requireImportService(importService).importOneNote(file, context);
    },
  },

View on GitHub (pinned to b4c8548c09)

Solutions

  1. Select a single .bear2bk backup file.
  2. Re-export from Bear if the file is missing.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown by the Bear import function when the selection does not contain exactly one .bear2bk backup file.

Common situations: The user picked no file or several files for a Bear import. Export a .bear2bk backup from Bear and choose that single file.


AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18). Data as JSON: /api/errors/547df3a277978291. Report an issue: GitHub.