Polymer DomModule already defined

2.2k Views Asked by At

I'm building a website, where I'd use different polymer components, some of them multiple times.

My problem is that the compiled code contains a

 customElements.define('dom-module', DomModule); 

that throws

Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry at CustomElementRegistry.value

I have no idea how to resolve this.

1

There are 1 best solutions below

1
Chris Gunawardena On

If you include polymer using two different paths in two different components, both of them gets executed and both tries to define dom-module, dom-if etc.

So check the networks panel for identical file names but different paths.

Example:

/bower_components/webcomponentsjs/webcomponents-loader.js
and
/components/webcomponentsjs/webcomponents-loader.js