3

The problem occur when several react apps with lexical editors are used at the same page.

The first app that is getting focus works as expected no matter which app it is, but as soon as another app is getting focus an error occur that lexical is unable to find an active editor state. The first app editor is still working as excepted (sometimes).

Uncaught Error: Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update() or editorState.read().
    at getActiveEditorState (Lexical.dev.js:7379:1)
    at $getNodeByKey (Lexical.dev.js:721:1)
    at ParagraphNode.getLatest (Lexical.dev.js:4090:1)
    at ParagraphNode.getParent (Lexical.dev.js:3690:1)
    at ParagraphNode.getIndexWithinParent (Lexical.dev.js:3664:1)
    at internalResolveSelectionPoint (Lexical.dev.js:6682:1)
    at internalResolveSelectionPoints (Lexical.dev.js:6787:1)
    at internalCreateRangeSelection (Lexical.dev.js:6898:1)
    at internalCreateSelection (Lexical.dev.js:6851:1)
    at beginUpdate (Lexical.dev.js:8008:1)

Everything works fine with one app and several editor components. But something seems to get out of sync when several apps is used.

I have tried to set the namespace in Lexical to an unique application ID but it doesn't makes any sense.

1
  • 1
    We've got the same issue, have you been able to figure out what was wrong? Commented Mar 14, 2024 at 16:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.