Skip to content

Comments

fix(Editor): guard calls for unavailable list extensions#6100

Open
dropdead619 wants to merge 1 commit intonuxt:v4from
dropdead619:fix/editor-guard-lift-missing-extensions
Open

fix(Editor): guard calls for unavailable list extensions#6100
dropdead619 wants to merge 1 commit intonuxt:v4from
dropdead619:fix/editor-guard-lift-missing-extensions

Conversation

@dropdead619
Copy link

🔗 Linked issue

Resolves #6099

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

The createListHandler in editor.ts unconditionally calls .lift('taskList') when switching between list types (e.g. bulletList → orderedList. Tiptap's .lift() internally calls getNodeType(), which throws if the node type is not in the schema:
Uncaught (in promise) Error: There is no node type named 'taskList'. Maybe you forgot to add the extension?

This happens because taskList is a separate extension (@tiptap/extension-task-list) not included in StarterKit, so it's not registered unless explicitly added by the user.

Fix: Added getAvailableListTypes() and liftFromLists() helpers that dynamically filter list types to only those registered in the editor's schema before calling .lift(). This ensures list type conversion works correctly regardless of which list extensions are loaded.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@github-actions github-actions bot added the v4 #4488 label Feb 25, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 05e5bd5 and 06a9d84.

📒 Files selected for processing (1)
  • src/runtime/utils/editor.ts

📝 Walkthrough

Walkthrough

This change refactors list type handling in the editor utility to support runtime detection of available list extensions rather than relying on hard-coded assumptions. Two new helper functions are introduced: getAvailableListTypes(editor) to identify active list extensions and liftFromLists(chain, editor) to sequentially unwrap available list wrappers. The canExecute check, list unwrapping logic, and list type conversion now use these runtime checks to determine which list node types are available, replacing compile-time references to bulletList, orderedList, and taskList.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: guarding lift() calls for unavailable list extensions to prevent runtime errors.
Description check ✅ Passed The description is directly related to the changeset, explaining the bug, root cause (taskList extension not always present), and the solution implemented.
Linked Issues check ✅ Passed The PR successfully addresses issue #6099 by implementing dynamic list type handling that prevents errors when taskList or other extensions are unavailable.
Out of Scope Changes check ✅ Passed All changes in editor.ts are focused on fixing the list type handling issue described in #6099; no out-of-scope changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 25, 2026

npm i https://pkg.pr.new/@nuxt/ui@6100

commit: 06a9d84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor throws "There is no node type named 'taskList'" when switching between orderedList and bulletList

1 participant