Skip to content

fix(text-editor): use one version range for every tiptap dependency - #206

Merged
clbotdev merged 1 commit into
mainfrom
fix/text-editor-tiptap-ranges
Nov 15, 2026
Merged

clbotdev merged 1 commit into
mainfrom
fix/text-editor-tiptap-ranges

Conversation

@clbotdev

Copy link
Copy Markdown
Contributor

Problem

npx @frontlit/preview@alpha frontlit crashes on a fresh install:

SyntaxError: The requested module '@tiptap/core' does not provide an export named 'isValidCSSStyleValue'
  at …/@frontlit/text-editor/node_modules/@tiptap/extension-table/dist/index.js

Cause

@frontlit/text-editor pinned three tiptap packages exactly (@tiptap/extension-code, @tiptap/extension-code-block and @tiptap/extensions at 3.31.3, added in 08c80fc) and gave the rest caret ranges (^3.0.0, ^3.10.7, …).

In the monorepo, bun.lock holds everything at 3.31.3, so nothing broke here. A fresh npm install, which is what npx does, behaves differently:

  • The caret ranges resolve to the latest tiptap (3.34.0), so @tiptap/extension-table 3.34.0 needs @tiptap/core ^3.34.0.
  • The pinned 3.31.3 packages need @tiptap/core 3.31.3, so npm nests a second core 3.31.3 under @frontlit/text-editor/node_modules.
  • extension-table sits in that same nested folder, so Node resolves it to core 3.31.3, which doesn't have isValidCSSStyleValue.

Fix

  • One range for all tiptap dependencies: every @tiptap/* dependency of @frontlit/text-editor is now ^3.31.3, so npm resolves a single tiptap version. Tiptap publishes all its packages together. bun.lock still resolves 3.31.3; only the specifiers changed.
  • Theme border colour in the preview: @frontlit/preview now gives borders the theme's border colour, as apps/sites/app/globals.css does (* { @apply border-border }). Without it, Tailwind 4 defaults borders to currentColor, so preview cards, dividers and the header border rendered in the text colour.

Changesets: @frontlit/text-editor patch and @frontlit/preview patch. @frontlit/page-builder pins text-editor exactly, so the changesets bump it too, and the preview picks up the fix once all three are released.

Verified

  • Fresh npm install: published @frontlit/preview@0.1.0-alpha.6, with this text-editor swapped in through overrides, installs a single @tiptap/core (3.34.0) instead of two. The preview starts and renders a 21-page site (CourseLit's frontlit/ folder).
  • Borders: with the CSS change, card borders compute to the theme's --border colour instead of the foreground colour. Utility classes such as ring-primary still win.
  • Tests: text-editor passes 110 of 110 and preview passes 2 of 2.

Three @tiptap packages were pinned to exactly 3.31.3 while the others used caret ranges. A fresh npm install resolved the ranges to the latest tiptap, nested a second @tiptap/core 3.31.3 for the pinned packages, and @tiptap/extension-table then loaded the old core and crashed on a missing isValidCSSStyleValue export. That broke npx @frontlit/preview@alpha.

Also gives borders the theme border colour in the local preview, matching apps/sites globals.css, so cards no longer render with text-coloured borders.
@clbotdev
clbotdev merged commit 04b747f into main Nov 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants