-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Uncaught TypeError: Cannot read property 'getIn' of undefined #2332
Comments
I've got the same error when I try to change a checkbox using medium-draft And Sentry reports it in the file Chrome Version 80.0.3987.132 (Official Build) (64-bit) |
And maybe it's related to issue #2204 because sometimes throw the error 🤔 |
Merged #2330 which should deal with |
@kenticomartinh had a look, the exception you're seeing has been fixed already, the changed have just not been published to npm. They'll be there once 0.11.5 comes around: @lavaldi, the issue you're seeing in |
UPDATE 1 After downloading 0.11.5 I'm still seeing this issue. The error manifests in different ways on different browsers, but the root of it seems to be "Invalid Selection State". It appears to be some kind of incompatibility with NextJS: https://codesandbox.io/s/reverent-fire-bvogb UPDATE 2 It appears the cause of this issue is the server rendering one thing with one selection state key, and then the client rendering a with a different key. See #1199 (comment) |
@davidgolden Did you find a solution regarding using DraftJS with NextJS? I'm still getting this issue and would have to consider moving to a different solution if this is persistent. |
@bathientran I did, the trick is to pass in a static key so that it's rendered the same on the server and the client, this is what's working for me (I'm also using
|
We are only doing client side rendering and getting this issue. Is there a fix? |
Thank you. For me this worked with next.js
|
Follow the workaround in this Example will solve this issue https://github.com/facebook/draft-js/blob/master/examples/draft-0-10-0/universal/editor.js Just simply create an empty content instead to use the function Here is my component is working with the
|
thank you very much my friend, i spent a lot of time looking for this solution. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When there are two DraftJS instances on the page, and you start the selection in one and finish it in the second, the editor crashes with the following error:
How to reproduce:
It seems that the editor detects the target is a DraftJS based on its markup structure but doesn't check it is its own instance. Therefore the selection handling assumes the existence of the underlying data, but the data is not found in current instance and it fails.
What is the expected behavior?
The editor does not throw an error, and updates the selection towards its end/start.
Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?
Chrome Version 80.0.3987.116 (Official Build) (64-bit)
DraftJS 0.11.4 (latest)
The text was updated successfully, but these errors were encountered: