Can't find property 'size' of undefined error
See original GitHub issueWhile using editor, I get this error. I checked the code and it asks for ‘decorators’ from editorState.getDecorator(). And in the actual editorState, it is saved as ‘_decorators’. That is why it says undefined. Any way to solve this ?
```
const currDec = curr.editorState.getDecorator();
const nextDec = next.editorState.getDecorator();
if (currDec === nextDec) return;
if (currDec && nextDec && currDec.decorators.size === nextDec.decorators.size) return;
![image](https://user-images.githubusercontent.com/22127106/35931356-6c0480a8-0c02-11e8-8385-4fc9d831ff1a.png)
Just to add, I tried changing the Editor/index.js code from 'decorators' to '_decorators' and it solved the problem.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
how to fix Cannot read property property 'size of' undefined
let files=$('input[type="file"]')[0].files; if(files[0]?.size){ var file_size = files[0].size; console.log(file_size); if (file_size > ...
Read more >Cannot Read Property Length of Undefined in JavaScript
The JavaScript TypeError: Cannot read property 'length' of undefined occurs when the length property is read on an undefined variable.
Read more >Cannot read property 'size' of undefined Error When ...
When attempting to login to SAM, the error message "Error: Cannot read property 'size' of undefined" is received. This error occurs when attempting...
Read more >Cannot read properties of undefined (reading 'length') - TrackJS
This message indicates that our code expects to have an object with a length property, but that object was not present. length is...
Read more >How to Prevent the Error: Cannot Read Property '0' of Undefined
What is the Cannot Read Property '0' of Undefined Error ... undefined is a special value in JavaScript that is used to indicate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’re about to push a fix for that btw, will let you guys know
this one is fixed now 👍