fix(entries): stop blank screen when editing a Markdown entry (#52) #55

Merged
claude-bot merged 2 commits from fix/v6.2-edit-blank-markdown into main 2026-06-29 16:29:53 +00:00
Contributor

Fixes #52.

Root cause

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 immediately calls editor.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:

Uncaught TypeError: can't access property "getMarkdown", n.storage.markdown is undefined
  at MarkdownEditor-*.js

Fix

  • Replace the third-party tiptap-markdown with the official, version-matched @tiptap/markdown@^3.27.1 (MIT; peer @tiptap/core ^3.27.1, exactly our installed version). Serialize via editor.getMarkdown(); parse/seed via setContent(md, { contentType: 'markdown' }). Initial content is seeded through the value-sync effect so it's always parsed as markdown.
  • Add a top-level ErrorBoundary so 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.)
  • Remove the obsolete 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/markdown in the lockfile, tiptap-markdown gone.
  • npm run buildtsc + vite build pass (so editor.getMarkdown() type-resolves).
  • npm test63/63 pass, including MarkdownEditor.test.tsx (markdown → strong/anchor, external-value sync with emitUpdate: 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

Fixes #52. ## Root cause `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 immediately calls `editor.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: ``` Uncaught TypeError: can't access property "getMarkdown", n.storage.markdown is undefined at MarkdownEditor-*.js ``` ## Fix - Replace the third-party `tiptap-markdown` with the **official, version-matched `@tiptap/markdown@^3.27.1`** (MIT; peer `@tiptap/core ^3.27.1`, exactly our installed version). Serialize via `editor.getMarkdown()`; parse/seed via `setContent(md, { contentType: 'markdown' })`. Initial content is seeded through the value-sync effect so it's always parsed *as* markdown. - Add a top-level **`ErrorBoundary`** so 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.) - Remove the obsolete `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/markdown` in the lockfile, `tiptap-markdown` gone. - `npm run build` — `tsc` + vite build pass (so `editor.getMarkdown()` type-resolves). - `npm test` — **63/63 pass**, including `MarkdownEditor.test.tsx` (markdown → strong/anchor, external-value sync with `emitUpdate: 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](https://claude.com/claude-code)
fix(entries): stop blank screen when editing a Markdown entry (#52)
Some checks failed
CI / App — typecheck, test & build (push) Failing after 13s
CI / API — typecheck & tests (push) Successful in 2m27s
3d24db1d82
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>
chore(app): regenerate package-lock for @tiptap/markdown (#52)
All checks were successful
CI / App — typecheck, test & build (push) Successful in 1m25s
CI / API — typecheck & tests (push) Successful in 2m7s
CI / App — typecheck, test & build (pull_request) Successful in 1m21s
CI / API — typecheck & tests (pull_request) Successful in 2m7s
8fb3c95dd3
Lockfile to match the dependency swap in the previous commit (host has no
node, so this was generated on the dev box). npm install: added 32, removed 16.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
claude-bot deleted branch fix/v6.2-edit-blank-markdown 2026-06-29 16:29:53 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rbrooks/TeaLeaves!55
No description provided.