Since version 0.22.0, registerCodeHighlighting throws - Lexical node does not exist in active editor state. Avoid using the same node references between nested closures from editorState.read/editor.update., when trying to create a code node within the initial editor state. I tested the code in the Codesandbox(below) with version 0.21.0 and it works like a charm.
Lexical version: 0.22.0
Steps To Reproduce
- Try to create a simple code block within the initial editor state as shown in the Codesandbox
- The editor throws an error from
registerCodeHighlighting

Link to code example: Codesandbox demo
The current behavior
The editor immediately throws an error
The expected behavior
The editor is able to create the initial editor state using create code node
Impact of fix
It happens every time when we want to create the initial editor state with code node