Download/polymer-cdn

Hello : Failed to execute 'define' on 'CustomElementRegistry':

Closed this issue · 5 comments

hello is that the following error appears
dom-bind.html:130 Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry

Hi @FuriosoJack,

Can you post a codepen/example?
The most common cause of this error is attempting to vulcanize dependencies. When using Polymer 2 from a CDN the dependencies must be imported in a flat way/registered only once, so they can be shared across components.
Polymer 2.3.1 is also getting to be a rather old distribution of Polymer. I will try to get a new version up sometime soon (The next 2 weeks, as work allows).

Well, basically the components that I am using are the following. Additionally I am using one that is the iron-form that is very important and is not in your cdn. Could this be the fault to use it? if so, how could you use cdn exrterno components that are not in your CDN. Thank you

<base href="https://cdn.rawgit.com/download/polymer-cdn/2.3.1/lib/">
<script src="webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="polymer/polymer.html">
<link rel="import" href="polymer/lib/elements/dom-if.html">
<link rel="import" href="paper-button/paper-button.html">
<link rel="import" href="paper-dialog/paper-dialog.html">
<link rel="import" href="iron-icons/iron-icons.html">
<link rel="import" href="iron-icon/iron-icon.html">
<link rel="import" href="paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import" href="paper-listbox/paper-listbox.html">
<link rel="import" href="paper-item/paper-item.html">
<link rel="import" href="paper-styles/paper-styles.html">
<link rel="import" href="iron-ajax/iron-ajax.html">
<link rel="import" href="paper-toast/paper-toast.html">
<link rel="import" href="paper-spinner/paper-spinner.html">
<link rel="import" href="paper-input/paper-input.html">
<link rel="import" href="https://cdn.rawgit.com/FuriosoJack/polymer-cdn/master/lib/iron-form/iron-form.html">
<link rel="import" href="paper-toast/paper-toast.html">

@FuriosoJack Have a look at the Contributing Guide. It explains how you can fork this repo and then use Bower to upgrade or add dependencies.

Make a branch in your fork before you start and if you succeed and commit/push the work to your Github, you will see that Github will offer you the option to create a PR based on the new branch. We can then from our end review your changes and merge them if they are ok.

This project uses Bower to manage the dependencies. It's actually not that difficult. There is a list of components that are needed and Bower installs all those components and their dependencies. That list can be found in bower.json in the root of this repo.

By the way, I see in your code example you already made a fork. In that case it's probably better to use your own fork as the base href:

<base href="https://cdn.rawgit.com/FuriosoJack/polymer-cdn/master/lib/">

As far as I understand it, Polymer does not like it if the same component is loaded from different URLs and I suspect mixing this repo with your own fork can cause issues.

I have already solved the errors this was due to the fact that I was using components of your CDN and another of mine when passing all of them to my CDN the error was solved. Additional power to merge this project with my fork since I have added some important components such as iron-fom.