我是飞镖和聚合物的初学者。当我用Chrome运行web应用程序时,我得到:
Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': Nodes of type 'HTML' may not be inserted inside nodes of type '#document'. patches-mdv.js:57
(anonymous function) patches-mdv.js:57
(anonymous function) patches-mdv.js:57
(anonymous function) patches-mdv.js:57appendChild可能在生成的dart2js代码中,即在以下部分:
Node: {
"^": "EventTarget;ownerDocument=,text:textContent=",
remove$0: function(receiver) {
var t1 = receiver.parentNode;
if (t1 != null)
J._removeChild$1$x(t1, receiver);
},
toString$0: function(receiver) {
var t1 = receiver.nodeValue;
return t1 == null ? J.Interceptor.prototype.toString$0.call(this, receiver) : t1;
},
append$1: function(receiver, newChild) {
return receiver.appendChild(newChild);
},
insertBefore$2: function(receiver, newChild, refChild) {
return receiver.insertBefore(newChild, refChild);
},
_removeChild$1: function(receiver, oldChild) {
return receiver.removeChild(oldChild);
},
_replaceChild$2: function(receiver, newChild, oldChild) {
return receiver.replaceChild(newChild, oldChild);
},
$isNode: true,
"%": "DocumentType|Notation;Node"
},我该怎么解决这个问题?
发布于 2014-08-07 21:36:10
正如在iR4/rygd5Ftk668J上所说的,从症状来看,platform.js似乎已经加载了两次。
因此,除toplevel index.html外,从每个html中删除以下两行:
<script src="packages/web_components/platform.js"></script>
<script src="packages/web_components/dart_support.js"></script>更新:聚合物> 0.14.0,不再需要platform.js。它由pub build和pub serve自动添加。
https://stackoverflow.com/questions/25190771
复制相似问题