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

The problem of svelte generating webcomponents ui component library #7165

Closed
wyysf123 opened this issue Jan 20, 2022 · 1 comment
Closed

Comments

@wyysf123
Copy link

Describe the problem

I am developing a set of ui components based on web components recently. The technology selection uses svelte, but with the development of the components, I found a problem, I hope svelte can be compatible, the problem is this, I developed the icon component, This component will be used in many components. The wc component is different from the previous svelte, react, and vue. It is packaged into shadowdom. If my button component and modal component use a certain component of icon, an error will be reported." Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "icon-triangle" has already been used with this registry", the solution is to change this section to "if (component.tag ! = null) {
body.push(b !@_customElements.get("${component.tag}") && @_customElements.define("${component.tag}", ${name}););
}"

Describe the proposed solution

"if (component.tag ! = null) {
body.push(b !@_customElements.get("${component.tag}") && @_customElements.define("${component.tag}", ${name}););
}"

Alternatives considered

"if (component.tag ! = null) {
body.push(b !@_customElements.get("${component.tag}") && @_customElements.define("${component.tag}", ${name}););
}"

Importance

would make my life easier

@baseballyama
Copy link
Member

Duplicate of #7595

@baseballyama baseballyama marked this as a duplicate of #7595 Feb 26, 2023
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

3 participants