[Bug]: Uncaught TypeError: Cannot read properties of undefined (reading 'props') at ReactNodeView.handleSelectionUpdate #5870
Labels
Category: Open Source
The issue or pull reuqest is related to the open source packages of Tiptap.
Type: Bug
The issue or pullrequest is related to a bug
Affected Packages
tiptap/react
Version(s)
2.9.1
Bug Description
We are encountering an issue where
this.renderer
is initialized correctly but becomes undefined during certain interactions. This typically occurs when repositioning floating variables in our editor. Occasionally, this issue also arises in production during regular text editing.This issue appears to be related to a lifecycle problem, where the
renderer
is not properly cleaned up or initialized under specific circumstances. Using null coalescing operators (e.g.,this.renderer?.props?.selected
) in @tiptap/react/dist/index.js:1367 seems to mitigate the issue, but this feels like a workaround rather than a proper solution.Stacktrace:
Environment
Steps to Reproduce
Expected Behavior
No TypeError and for the
renderer
to handle intermittent undefined values, or not take undefined valuesAdditional Context (Optional)
The issue seems to stem from the ReactNodeView lifecycle. Using null coalescing operators for accessing this.renderer.props.selected appears to resolve the issue temporarily but does not address the root cause.
Dependency Updates
The text was updated successfully, but these errors were encountered: