HierarchyRequestError: Failed to execute 'appendChild' on 'Node'

醉酒当歌 提交于 2020-05-27 07:34:31

问题


Can someone please explain why the following error occurs and what it means?

Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': Nodes of type 'HTML' may not be inserted inside nodes of type '#document'.

I am not sure I am able to reproduce it but it occurs from time to time, usually when I import more than one custom element. It's extremely hard giving exact context since I am working on integrating polymer's paper/core elements for our in-house widgets. Broadly speaking what are the cases that I would see this error? Any kind of help is appreciated. Thank you.

Regards, Raja


回答1:


I just had this same issue. I was importing core-icon.html

I discovered that the core-meta.html also includes the polymer.html, which I had already imported. I commented out the line in the core-meta.html that imported the polymer.html and my errors went away.



来源:https://stackoverflow.com/questions/26766181/hierarchyrequesterror-failed-to-execute-appendchild-on-node

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!