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
A few version back there was a white screen shown with a block not found error message. Now an error boundary is hit and displays this error code whenever a serialized node contains an unknown block:
Cannot read properties of undefined (reading '0')
The above error occurred in the <Pr> component. It was handled by the <ErrorBoundary> error boundary. Error Component Stack
at Pr (index.js:945:15)
at Suspense (<anonymous>)
at ErrorBoundary (LexicalErrorBoundary.dev.mjs:51:35)
at LexicalErrorBoundary (LexicalErrorBoundary.dev.mjs:126:3)
at RichTextPlugin (LexicalRichTextPlugin.dev.mjs:158:3)
The editor is no longer functional i.e. the document is blocked from being edited and the error code is not meaningful.
The Lexical editor should be able to handle such cases:
detect unknown blocks: show console error message
display an error block which keeps the serialized node data as is
error block can be deleted (unknown code will be gone)
developer can add the missing block (on reload edit works normally again)
probably a way to view, edit or copy the serialized data to fix the issue (e.g. a block was renamed)
add error hook to modify unknown blocks on the fly (e.g. update data or convert to other nodes)
Describe the Bug
A few version back there was a white screen shown with a block not found error message. Now an error boundary is hit and displays this error code whenever a serialized node contains an unknown block:
Cannot read properties of undefined (reading '0')
The editor is no longer functional i.e. the document is blocked from being edited and the error code is not meaningful.
The Lexical editor should be able to handle such cases:
Link to the code that reproduces this issue
https://github.com/cbratschi/payload
Reproduction Steps
Which area(s) are affected? (Select all that apply)
plugin: richtext-lexical
Environment Info
The text was updated successfully, but these errors were encountered: