jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.4k stars 1.16k forks source link

Redux editor state - console warrnings about immutable.js #617

Open jan0991 opened 6 years ago

jan0991 commented 6 years ago

I keep getting this:

https://stackoverflow.com/questions/48893536/iterable-length-has-been-deprecated

Not sure if it's a bug or I am doing something wrong, but I tried a bunch of things and nothing seems to help. It's super annoying as it happens on every key press, any ideas?

cacharrin commented 6 years ago

Im getting the same warning a lot of times in the console.

iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version

I'm concerned about: "This warning will become a silent error in a future version"

Any ideas how to solve it?

jpuri commented 6 years ago

Which version of immutableJS are you using, I am not able to replicate this issue. If possible can you share the repo so i can try to reproduce this.

cacharrin commented 6 years ago

Sure.

I'm not requiring immutableJs directly, but running npm ls immutable output this:

+-- browser-sync@2.18.13
| +-- browser-sync-ui@0.6.3
| | `-- immutable@3.8.1  deduped
| `-- immutable@3.8.1
`-- draft-js@0.10.5
  `-- immutable@3.7.6

Let me know if you need something else, and thank you ;)

loborobo commented 4 years ago

Apparently, the answer is to force Yarn to use immutable 3.8.2:

"resolutions": {
    "**/draft-js/immutable": "3.8.2"
},
"dependencies": {
     ...my dependencies
}

source: https://github.com/facebook/draft-js/issues/950#issuecomment-456977301