CustomElements.js:596Uncaught TypeError: Cannot assign to re

CustomElements.js:596Uncaught TypeError: Cannot assign to read only property 'customElements' of object '#<Window>'

本文关键字:assign to Cannot re TypeError js 596Uncaught CustomElements      更新时间:2023-09-26

我们正在利用skateJS并使用webcomponent.js进行多边形填充。然而,自从今天新发布的Google Chrome(版本54.0.2840.71),我们的应用抛出了一个致命的错误。

customElements .js:596Uncaught TypeError: Cannot assign给object '#'的只读属性'customElements'

从54版开始,Chrome引入了一个新的全局变量customElements,实际上是window.customElements,这是自定义元素v1规范的一部分。

它必须与您在自己的代码中使用的相同变量冲突(猜想在文件CustomElements.js中)。你需要重命名它