Why the editor autosave was silently failing
A null prototype and a content-dependent bug
tobi · · 1 min read
The symptom
Autosave failed only when the document contained a heading.
const source = editorRef.current?.getJSON() ?? props.initialDoc
const doc = JSON.parse(JSON.stringify(source)) as RillDocWhy
ProseMirror builds node attrs with a null prototype, and React only serializes plain objects as data.