-
Notifications
You must be signed in to change notification settings - Fork 661
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry #1123
Comments
Duplicate dependencies - see my comment/thread at PolymerElements/paper-button#174 (comment) |
Thanks. Deleting the |
From my understanding of NPM (which is somewhat limited), the given package-lock.json gives you Our current position is to provide package-lock.json because it guarantees that, at least initially, you'll get the same set of dependencies as us when you run |
Wanted to add: some package managers like Yarn will also guarantee no duplicate dependencies, but last I tried it did not work with pwa-starter-kit (another project) because the build/server Node.js dependencies rely on different versions of the same package. Ideally, you want no duplicates for browser code but potentially allow duplicates for Node.js code). There have been some work on the team towards this, but not a satisfying solution yet. |
Sorry, what is the process for adding dependencies?
I think new users might find it confusing following the guide. Should there be a note? Thanks! |
Yes, I made a PR for the docs site with a note about this. Looks like it's merged but not deployed yet. |
Thank you @keanulee! |
I'm on windows and
|
I deleted the folder in windows explorer and npm i and the problem persisted. I remove manually each subfolder node_modules and edited each pachage.json changing _phantomchildren to empty like |
Did you delete the |
yes, but when I npm i the problem continued |
I couldn't reproduce the issue with a fresh clone and |
I'll try if i install more elements. I never used @next. and what's the "_phantomChildren" for? |
We have a method for resolving these issues, it is to do with removing nested @Polymer modules. Check it out here : |
in local dev toss this in a script tag b4 the type modules
|
Thanks @btopro I was able to use this solution in an Ionic4/angular project where the elements.module had to be imported into multiple other modules! |
I made this a small library that does the same thing and I include it on my demo pages just to be safe -- https://www.npmjs.com/package/@lrnwebcomponents/deduping-fix |
not work in safari |
For some stuff, it works well. But, for some other I get some problem with the layout and component styles broken. The one link from @flatmax here Polymer/polymer#5407 is working well, but it's too complex for many dependencies. I dont think to run npm preinstall for every components I created. Very frustrated with this problem over months? |
It's a bandaid package for sure, def causes some issues. Polymer/polymer#5407 (comment) is what we do now with much better results |
How do you use this library? Just include it in the project? |
Add to the page as a script much like a polyfill |
Description
Insert paper-input into a fresh Polymer 3 polymer-3-starter-kit app.
Expected outcome
App displays with paper-input
Actual outcome
Blank page displayed and due to error:
IE11 displays this error:
Firefox error:
Error: A custom element with name 'iron-meta' has already been defined. webcomponents-sd-ce.js:2244:32
Steps to reproduce
paper-input
element in the page inside app-toolbar in my-app.jsimport '@polymer/paper-input/paper-input.js';
to my-app.jsBrowsers Affected
The text was updated successfully, but these errors were encountered: