toeverything/AFFiNE · error · Error
Expected a single zip file for markdownZip import
Error message
Expected a single zip file for markdownZip import
What it means
Thrown in the markdownZip import config when the file picker did not yield exactly one file (none or multiple), since markdown zip import accepts a single zip archive only; a caller-input contract violation.
Source
Thrown at packages/frontend/core/src/desktop/dialogs/import/index.tsx:313
collection: docCollection,
schema: getAFFiNEWorkspaceSchema(),
markdown: text,
fileName,
extensions: getStoreManager().config.init().value.get('store'),
});
if (docId) docIds.push(docId);
}
return {
docIds,
};
},
},
markdownZip: {
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 markdownZip import');
}
return requireImportService(importService).importMarkdownZip(
file,
context
);
},
},
html: {
fileOptions: { acceptType: 'Html', multiple: true },
importFunction: async ({ docCollection, files }) => {
const docIds: string[] = [];
for (const file of files) {
const text = await file.text();
const fileName = file.name.split('.').slice(0, -1).join('.');
const docId = await HtmlTransformer.importHTMLToDoc({
collection: docCollection,
schema: getAFFiNEWorkspaceSchema(),
extensions: getStoreManager().config.init().value.get('store'),View on GitHub (pinned to b4c8548c09)
Solutions
- Select exactly one zip file for markdownZip import.
- Re-pick the file in the import dialog.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown by the markdownZip import function when the picked file list does not contain exactly one file, violating the single-zip expectation.
Common situations: The user cancels the picker or selects zero/multiple files for a Markdown zip import. Select exactly one exported zip archive and retry.
AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18).
Data as JSON: /api/errors/143e443f7b7fe376.
Report an issue: GitHub.