toeverything/AFFiNE · error
Failed to parse attachment footnote definition:
Error message
Failed to parse attachment footnote definition:
What it means
Warning logged in the attachment markdown-adapter walker when parsing the footnote definition for an attachment citation fails — the footnote's JSON does not parse or does not match FootNoteReferenceParamsSchema. The attachment is simply not converted (the node is skipped) and the adapter keeps walking the rest of the markdown.
Source
Thrown at blocksuite/affine/blocks/attachment/src/adapters/markdown.ts:74
return;
}
walkerContext
.openNode(
createAttachmentBlockSnapshot({
id: nanoid(),
props: {
name: fileName,
sourceId: blobId,
footnoteIdentifier,
style: 'citation',
},
}),
'children'
)
.closeNode();
walkerContext.skipAllChildren();
} catch (err) {
console.warn('Failed to parse attachment footnote definition:', err);
return;
}
},
},
fromBlockSnapshot: {},
};
export const AttachmentBlockMarkdownAdapterExtension =
BlockMarkdownAdapterExtension(attachmentBlockMarkdownAdapterMatcher);
View on GitHub (pinned to b4c8548c09)
Solutions
- Fix the attachment footnote syntax in the markdown source.
- Remove the malformed footnote definition.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Triggered when the markdown adapter fails to JSON-parse or decode the footnote definition attached to an attachment node during markdown import, causing the attachment footnote to be skipped.
Common situations: Occurs when importing markdown content containing malformed or hand-edited attachment footnotes. The affected attachment is skipped; verify the footnote definition is valid JSON.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18).
Data as JSON: /api/errors/a68ff8637b300816.
Report an issue: GitHub.