Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Too much warning message in browser console. #1647

Closed
LeonDWong opened this issue Feb 12, 2018 · 7 comments
Closed

Too much warning message in browser console. #1647

LeonDWong opened this issue Feb 12, 2018 · 7 comments

Comments

@LeonDWong
Copy link

Latest draft.js(0.10.5) requires immutable.js which's version is defined between 3.7.0 to 3.7.x as dependency, it prints too much warning message when it runs in browser. See below.
image
AFAIK, immutable.js won't print this message once it is updated to 3.8.x, similar issue
Could it be fixed? Thx.

@thibaudcolas
Copy link
Contributor

thibaudcolas commented Feb 12, 2018

@LeonDWong as far as I can see, the Immutable dependency hasn't changed in 0.10.5 – it's still ~3.7.4.

I don't see any of those warning messages in my editor, are you sure you're not using another version of Immutable? You can check this with npm ls immutable from within your project.

@LeonDWong
Copy link
Author

@thibaudcolas
Yes, immutable.js used in draft.js is 3.7.x, and latest immutable.js version matching 3.7.x is 3.7.6, which installed by draft. And it could be updated to 3.8.x, i think it should make those warning disappear.
image

@thibaudcolas
Copy link
Contributor

I haven't seen those warnings in my Draft.js projects using Immutable 3.7.x, so most likely they are produced because some other (not Draft.js?) part of the code which depends on Immutable is using the wrong version, or using those deprecated APIs.

There is already another issue about updating it in Draft.js, over at #950.

@hxgdzyuyi
Copy link

This warning can be disabled with Immutable.Iterable.noLengthWarning = true; in [email protected]

@LeonDWong
Copy link
Author

It seems like that other updating issue already exist. Closed.

@maiah
Copy link

maiah commented Mar 1, 2018

@hxgdzyuyi where should we put the Immutable.Iterable.noLengthWarning = true; ?

@hxgdzyuyi
Copy link

hxgdzyuyi commented Mar 1, 2018

@maiah

you can put it into your entry file(before use immutable.js).

such as:

import React from 'react'
import ReactDOM from 'react-dom'
import MainSection from './MainSection'
....
import Immutable from 'immutable'

// See more: https://github.com/facebook/draft-js/issues/950
Immutable.Iterable.noLengthWarning = true

....

ReactDOM.render(
  <Provider store={store}>
    <MainSection />
  </Provider>,
  document.getElementById('react-app-root')
)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants