react-lite icon indicating copy to clipboard operation
react-lite copied to clipboard

newNode.replaceData is not a function.

Open RickCarlino opened this issue 7 years ago • 1 comments

I've been running React Lite in production for a week and just found the following error report:

Uncaught TypeError: r.replaceData is not a function

(Chrome 56, Windows, running react-lite 0.15.33)

After un-minifying the code, I'm pretty sure it would have read:

Uncaught TypeError: newNode.replaceData is not a function

I'm basing that off of this source code here.

Unfortunately, I don't have a whole lot of other information available. Are there any common gotchas that would cause newNode to not have a replaceData function?

Sorry for the lack of info on this one. Please let me know if there is any other information I can provide, and thanks for all the great work on this project.

RickCarlino avatar Mar 09 '17 15:03 RickCarlino

newNode must be a textNode of DOM which has a method named replaceData.

The diff of virtual-dom show that we should update a textNode, but the real-dom is not a textNode.

Append a dom-element which is not created by virtual-dom, or remove a dom-element which is created by virtual-dom, will cause this error. It means that we can't change the status of dom.children for keeping it the same as virtual-dom.

Look out whether there is somewhere mix virtual-dom and real-dom.

Lucifier129 avatar Mar 10 '17 01:03 Lucifier129