-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Uncaught TypeError: Cannot read properties of undefined (reading 'props') at ReactNodeView.handleSelectionUpdate #5870
Comments
Would be ideal to have a codesandbox that reproduces this issue. I agree that adding null checks is not ideal so I would prefer to find the root cause |
Sorry for the delay, setting up a sandbox for reproducing the issue. |
@rushillshah @nperez0111 I'm facing this exact issue with virtually the same stack trace. I tried adding null coalescing
But unlike for @rushillshah this doesn't change the error at all for me. My minimal reproduction attempt below doesn't reproduce the error https://codesandbox.io/p/sandbox/tiptap-react-qidlsv So I've linked the full repo below: https://github.com/Eusaybia/lifemap/tree/sales-guide You can just And go to
And then refresh the page after it's loaded once. The error should appear at that point. Note: You need access to your own TipTap Pro key, otherwise
|
Sorry but to help you here, I'd need a repo that is much more minimal than this, way too many things to check |
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: