toeverything/AFFiNE · error · Error
com.affine.import.status.failed.message.no-file-selected
Error message
com.affine.import.status.failed.message.no-file-selected
What it means
The file-picker step of handleImport returned no files for the chosen import type, so there is nothing to hand to the import function; the dialog surfaces this localized failure message via setImportError instead of running an import with an empty selection.
Source
Thrown at packages/frontend/core/src/desktop/dialogs/import/index.tsx:731
if (importConfig.nativeOnly && !BUILD_CONFIG.isElectron) {
throw new Error(t['com.affine.import.onenote.desktop-only']());
}
const { acceptType, multiple } = importConfig.fileOptions;
const files =
acceptType === 'Skip'
? []
: acceptType === 'Directory'
? await openDirectory({
fileSystemAccess: false,
})
: await openFilesWith(acceptType, multiple, {
fileSystemAccess: false,
snapshot: shouldSnapshotPickedFiles(type, acceptType),
});
if (!files || (files.length === 0 && acceptType !== 'Skip')) {
throw new Error(
t['com.affine.import.status.failed.message.no-file-selected']()
);
}
if (acceptType !== 'Skip') {
setStatus('importing');
track.$.importModal.$.import({
type,
status: 'importing',
});
}
const abortController = new AbortController();
importAbortControllerRef.current = abortController;
const {
docIds,
entryId,
isWorkspaceFile,View on GitHub (pinned to b4c8548c09)
Solutions
- Select a file before starting the import.
- Re-open the file picker and choose an archive.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown in handleImport when the file picker returns no files for a type that requires input, meaning the user cancelled or the selection was empty.
Common situations: The import dialog reports failure because no file was selected. Reopen the picker and choose at least one supported file before importing.
AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18).
Data as JSON: /api/errors/669a48c16624386b.
Report an issue: GitHub.