It seems that Lexical loads up fine if it's at the starting/root level of the fields property in a CollectionConfig, but using lexicalRichTextField() as a sub-element in a field of type array causes the following error to appear on screen:
Cannot read properties of undefined (reading 'type')
In Developer Tools console, the following error appears:
Uncaught TypeError: Cannot read properties of undefined (reading 'type')
at $parseSerializedNodeImpl (Lexical.dev.js:7526:1)
at parseEditorState (Lexical.dev.js:7577:1)
at LexicalEditor.parseEditorState (Lexical.dev.js:10791:1)
at initializeEditor (LexicalComposer.dev.js:106:1)
at LexicalComposer.dev.js:66:1
at mountMemo (react-dom.development.js:17225:1)
at Object.useMemo (react-dom.development.js:17670:1)
at Object.useMemo (react.development.js:1650:1)
at LexicalComposer (LexicalComposer.dev.js:46:1)
at renderWithHooks (react-dom.development.js:16305:1)
For example, using lexicalRichTextField() as such, works OK:
It seems that Lexical loads up fine if it's at the starting/root level of the
fields
property in aCollectionConfig
, but usinglexicalRichTextField()
as a sub-element in a field of typearray
causes the following error to appear on screen:In Developer Tools console, the following error appears:
For example, using
lexicalRichTextField()
as such, works OK:... but doing the following causes the error:
(I've edited this comment to add some code examples).