聚合物2:组合来自不同位置的海关标签

时间:2019-01-11 14:29:42

标签: javascript html polymer

我目前正在使用Polymer 2(*),遇到问题...

我想提供基于特定位置的托管服务,该位置基于自定义标签,可以嵌入到其他随机的Web应用程序中。我已经完成标记,该标记封装了一个小工具并添加了CORS标头。为了进行测试,我编写了一个嵌入页面的普通JavaScript页面。一切正常。

下一个测试用例是一个小型的Polymer 2应用程序,它也使用(嵌入)标签。两者(嵌入应用程序和嵌入式应用程序都包含一些纸制*标签,而这正是问题所在:浏览器告诉我,他们无法注册某些标签,因为已经注册了。我知道,这个问题通常是在导入同一标签的不同版本或整个应用程序中导入路径不一致时发生的,但对于我而言,这不是错误,而是功能。我想独立于嵌入式自定义技术标签是构建的。

Chrome 71:

dom-if.html:305 Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry
at [...]/bower_components/polymer/lib/elements/dom-if.html:305:18
at [...]/bower_components/polymer/lib/elements/dom-if.html:309:3

Firefox 64:

NotSupportedError: Operation is not supported dom-if.html.js:292
<anonymous>
[...]/bower_components/polymer/lib/elements/dom-if.html.js:292:3
<anonymous>
[...]/bower_components/polymer/lib/elements/dom-if.html.js:1:2

`

关于如何解决此问题的任何建议?我尝试捆绑以使组件扁平化,但未能成功解决该问题。

-Mik68

(*)好吧,我承认,Polymer 2不是最新的/最新的东西,但我必须坚持下去,直到整个项目换档。

0 个答案:

没有答案