Skip to content

[lexical] Chore: Improve error message when a node is registered from a foreign lexical module#7821

Merged
etrepum merged 2 commits intofacebook:mainfrom
etrepum:version-detection
Sep 17, 2025
Merged

[lexical] Chore: Improve error message when a node is registered from a foreign lexical module#7821
etrepum merged 2 commits intofacebook:mainfrom
etrepum:version-detection

Conversation

@etrepum
Copy link
Copy Markdown
Collaborator

@etrepum etrepum commented Sep 17, 2025

Description

People can get themselves into scenarios where multiple versions of lexical are on the same page. We have some detection for this already with editors, but it doesn't get caught when an editor is configured with nodes that subclass nodes from some other version of lexical. This adds an additional check and provides a detailed error message for that scenario.

Closes #7819

Test plan

Unit test to verify that an error happens in this sort of case.

FakeLexicalNode (type fake-node) does not subclass LexicalNode from the lexical package used by this editor (version 0.35.0+git). All lexical and @lexical/* packages used by an editor must have identical versions. If you suspect the version does match, then the problem may be caused by multiple copies of the same lexical module (e.g. both esm and cjs, or included directly in multiple entrypoints).

@vercel
Copy link
Copy Markdown

vercel bot commented Sep 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
lexical Ready Ready Preview Comment Sep 17, 2025 3:45am
lexical-playground Ready Ready Preview Comment Sep 17, 2025 3:45am

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 17, 2025
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Sep 17, 2025
@etrepum etrepum added this pull request to the merge queue Sep 17, 2025
Merged via the queue into facebook:main with commit 212ee96 Sep 17, 2025
39 checks passed
This was referenced Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: LexicalNode does not implement .getType()

2 participants