question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't find property 'size' of undefined error

See original GitHub issue

While 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:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
juliankrispelcommented, Apr 24, 2018

We’re about to push a fix for that btw, will let you guys know

0reactions
juliankrispelcommented, May 3, 2018

this one is fixed now 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found