toeverything/AFFiNE · error · Error

Expected a single zip file for notion import

Error message

Expected a single zip file for notion import

What it means

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.

Source

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

          collection: docCollection,
          schema: getAFFiNEWorkspaceSchema(),
          extensions: getStoreManager().config.init().value.get('store'),
          html: text,
          fileName,
        });
        if (docId) docIds.push(docId);
      }
      return {
        docIds,
      };
    },
  },
  notion: {
    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 zip file for notion import');
      }
      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) {

View on GitHub (pinned to b4c8548c09)

Solutions

  1. Select exactly one zip file exported from Notion.
  2. Re-pick the file in the import dialog.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown by the Notion import function when files.length is not exactly one, since Notion import requires a single exported zip archive.

Common situations: The Notion import was started without choosing exactly one zip export. Export the workspace from Notion as a zip and select that single file.


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