Skip to content
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

Failed to execute 'define' on 'CustomElementRegistry': the name "clr-icon" has already been used with this registry #267

Open
swathishetty opened this issue Aug 28, 2023 · 3 comments

Comments

@swathishetty
Copy link

swathishetty commented Aug 28, 2023

I am trying to build a plugin on virtual cloud direct(VCD) container. The VCD container already has the clr-icon registered. I am using a third party library in the plugin which internally uses clarity icons(custom icons).I am getting the below error on integrating the plugin to the application because of the re-registration.
image

Is there any way to fix this issue ? Thanks

@kevinbuhmann
Copy link
Member

I think you will need to make sure your application does not register the same element/tag twice. This is an issue your application code, not the library. You can check if an element has already been registered by calling customElements.get('tag-name').

Note that clr-icon is no longer supported in favor of cds-icon.

@swathishetty
Copy link
Author

just on importing an external module in the code i am getting this error. The external module is using clr-icons internally. On plugging in this code(with external module) to the VMware Cloud Director Portal, I am getting the registery error. As per my understanding the VMware Cloud Director Portal also uses clarity and clr-icons. Does any additional webpack configuration would help in overriding the central registry and pick the one loaded from plugin code?

@kevinbuhmann
Copy link
Member

You might have to address the issue with your dependency. I am not sure about solving it with webpack, but there might a way to replace to register.js file with a no-op file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants