toeverything/AFFiNE · error · Error

No importable documents were found in the selected file.

Error message

No importable documents were found in the selected file.

What it means

Thrown at the end of commitNativeImport when the native importer finished but produced no doc ids and the archive was not a workspace file, meaning the selected file contained nothing importable. Callers surface this to the user as an empty-import message.

Source

Thrown at packages/frontend/core/src/desktop/dialogs/import/native-backend.ts:84

      entryId ??= batch.entryId;
      isWorkspaceFile ||= !!batch.isWorkspaceFile;
      rootFolderId ??= result.rootFolderId;
    }
  } catch (error) {
    if (!cancelled) {
      try {
        await native.cancelImportSession(sessionId);
      } catch {
        // Preserve the original import error.
      }
    }
    throw error;
  } finally {
    await native.disposeImportSession(sessionId);
  }

  if (!docIds.length && !isWorkspaceFile) {
    throw new Error('No importable documents were found in the selected file.');
  }

  return {
    docIds,
    entryId,
    isWorkspaceFile,
    rootFolderId,
    warnings,
  };
}

async function getNativeImporter(): Promise<NativeImportSessionHandlers> {
  const registered = getNativeImportSessionHandlers();
  if (registered) {
    return registered;
  }
  throw new Error('Native import session handlers are not registered');
}

View on GitHub (pinned to b4c8548c09)

Solutions

  1. Choose a file that actually contains importable documents.
  2. Check the file format matches the selected import type.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown after a native import session completes when no document ids were committed and the source was not a workspace file, i.e. nothing importable was extracted.

Common situations: Occurs when the chosen file contains no supported documents (e.g. empty or unrelated archive). Pick a file with importable Markdown/HTML documents.


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