fix(entries): stop blank screen when editing a Markdown entry (#52) #55
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/v6.2-edit-blank-markdown"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #52.
Root cause
tiptap-markdown@0.9.0does not registereditor.storage.markdownunder tiptap v3 (@tiptap/* 3.27.x). Opening Edit on a Markdown entry mountsMarkdownEditor, whose mount effect immediately callseditor.storage.markdown.getMarkdown()→TypeError: …markdown is undefined. With no React error boundary in the app, that throw unmounts the entire tree to a blank white screen. Plain-text entries (and new entries, which default to plain) don't mount the editor, so they were unaffected — which is why it looked intermittent.Confirmed live via the browser console:
Fix
tiptap-markdownwith the official, version-matched@tiptap/markdown@^3.27.1(MIT; peer@tiptap/core ^3.27.1, exactly our installed version). Serialize viaeditor.getMarkdown(); parse/seed viasetContent(md, { contentType: 'markdown' }). Initial content is seeded through the value-sync effect so it's always parsed as markdown.ErrorBoundaryso any future render error shows a recoverable "Something went wrong / Reload" message instead of a blank page. (This is what amplified a small component bug into a full whiteout.)tiptap-markdown.d.ts; update the Renovate rule to keep all@tiptap/*packages in lockstep.Verification (on the dev box)
npm install— added 32, removed 16;@tiptap/markdownin the lockfile,tiptap-markdowngone.npm run build—tsc+ vite build pass (soeditor.getMarkdown()type-resolves).npm test— 63/63 pass, includingMarkdownEditor.test.tsx(markdown → strong/anchor, external-value sync withemitUpdate: false).Still worth a manual smoke once deployed: edit a Markdown entry → no blank screen, existing formatting renders, edit + save, reopen → markdown round-trips; and confirm a plain entry still edits.
🤖 Generated with Claude Code
tiptap-markdown@0.9.0 does not register editor.storage.markdown under tiptap v3 (@tiptap/* 3.27.x). Opening Edit on a Markdown entry mounts MarkdownEditor, whose mount effect calls editor.storage.markdown.getMarkdown() and throws "markdown is undefined" — and with no error boundary, the whole app unmounts to a blank white screen. - Replace tiptap-markdown with the official, version-matched @tiptap/markdown (serialize via editor.getMarkdown(); parse via setContent(md, { contentType: 'markdown' })). Seed initial content through the value-sync effect so it is always parsed as markdown. - Add a top-level ErrorBoundary so a render error shows a recoverable message instead of blanking the app. - Drop the obsolete tiptap-markdown.d.ts; group all @tiptap/* in Renovate. Lockfile regenerated on the dev box (host has no node); see follow-up commit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>