You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
editor-component.tsx:104 Uncaught Error: Expected node 10 to have closest block element node.
at Object.$getNearestBlockElementAncestorOrThrow (chunk-WDPDQGT4.js?v=441f9f23:363:17)
at handleIndentAndOutdent (chunk-NTIMGF3I.js?v=441f9f23:880:35)
at Array.<anonymous> (chunk-NTIMGF3I.js?v=441f9f23:993:16)
at triggerCommandListeners (chunk-37CEAJO2.js?v=441f9f23:7170:33)
at dispatchCommand (chunk-37CEAJO2.js?v=441f9f23:1091:14)
at LexicalEditor.dispatchCommand (chunk-37CEAJO2.js?v=441f9f23:8532:16)
at Array.<anonymous> (custom-tab-identation-plugin.tsx:87:23)
at triggerCommandListeners (chunk-37CEAJO2.js?v=441f9f23:7170:33)
at chunk-37CEAJO2.js?v=441f9f23:7154:23
at beginUpdate (chunk-37CEAJO2.js?v=441f9f23:7276:9)
Link to code example:
This exists in the lexical playground. I believe the issue is that LexicalRichText calls $getNearestBlockElementAncestorOrThrow on the DecoratorNode. $getNearestBlockElementAncestorOrThrow has an exception raising check if (!$isElementNode(blockNode)) { but a DecoratorNode is not an ElementNode, thus raises an exception.
Lexical version: Latest on playground as of Feb 22, 2024.
Steps To Reproduce
Link to code example:
This exists in the lexical playground. I believe the issue is that LexicalRichText calls
$getNearestBlockElementAncestorOrThrow
on the DecoratorNode.$getNearestBlockElementAncestorOrThrow
has an exception raising checkif (!$isElementNode(blockNode)) {
but a DecoratorNode is not an ElementNode, thus raises an exception.https://github.com/facebook/lexical/blob/main/packages/lexical-rich-text/src/index.ts#L508
https://github.com/facebook/lexical/blob/main/packages/lexical-utils/src/index.ts#L239
Note similar code is in the LexicalTabIndentationPlugin which may also cause issues:
The current behavior
The expected behavior
The text was updated successfully, but these errors were encountered: