-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting duplicate registry when importing Paper-Input in polymer 3.0 #652
Comments
Hi, I'm using |
This seems to be a duplication error of the polymer.js element try
Make sure that no component extracts some bower_components files Update: |
@herberthobregon rm -rf / ... really? |
Yup, the problem is that you're importing polymer twice. Check out the second answer in the faq for a workaround |
The FAQ workaround is not the best solution IMO. |
Description
Having these imports:
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
import { setPassiveTouchGestures, setRootPath } from '@polymer/polymer/lib/utils/settings.js';
import '@polymer/app-layout/app-drawer/app-drawer.js';
import '@polymer/app-layout/app-drawer-layout/app-drawer-layout.js';
import '@polymer/app-layout/app-header/app-header.js';
import '@polymer/app-layout/app-header-layout/app-header-layout.js';
import '@polymer/app-layout/app-scroll-effects/app-scroll-effects.js';
import '@polymer/app-layout/app-toolbar/app-toolbar.js';
import '@polymer/app-route/app-location.js';
import '@polymer/app-route/app-route.js';
import '@polymer/iron-pages/iron-pages.js';
import '@polymer/iron-selector/iron-selector.js';
import "@polymer/paper-button/paper-button.js";
import "@polymer/iron-flex-layout/iron-flex-layout-classes.js";
import "@polymer/paper-dialog/paper-dialog.js";
import "@polymer/paper-input/paper-input.js";
import './my-icons.js';
The paper-input import breaks the app, saying that the name of the CustomElement has already been used.
Actual outcome
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry
at Polymer (http://127.0.0.1:8081/node_modules/@polymer/polymer/lib/legacy/polymer-fn.js:43:18)
at http://127.0.0.1:8081/node_modules/@polymer/iron-meta/iron-meta.js:131:1
UPDATE: I've noticed that it has to do with this import:
import { Polymer } from '@polymer/polymer/lib/legacy/polymer-fn.js';
on paper-input.js. It looks like another of my import has the same import, but removing it doesn't work.
I tried editing Polymer-fn.js like this:
if(customElements.get(klass)!=null) {
customElements.define(klass.is, /** @type {!HTMLElement} */(klass));
return klass;
}
else{
return customElements.get(klass);
}
But it now throws:
Uncaught TypeError: Cannot set property 'instance' of undefined
at iron-a11y-announcer.js:105
I don't know what else to try.
Steps to reproduce
Set up the sample page on polymer 3.0, and add those dependencies.
Browsers Affected
The text was updated successfully, but these errors were encountered: