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

Vite hot reload fail #8

Closed
Thykof opened this issue Mar 1, 2024 · 2 comments
Closed

Vite hot reload fail #8

Thykof opened this issue Mar 1, 2024 · 2 comments

Comments

@Thykof
Copy link

Thykof commented Mar 1, 2024

With react vite application, I got

DOMException: CustomElementRegistry.define: 'identicon-svg' has already been defined as a custom element

and

[hmr] Failed to reload /src/App.tsx. This could be due to syntax errors or importing non-existent modules. (see errors above)

This is because a custom element can only be defined once. A solution would be to do something like:

if (!customElements.get('identicon-svg')) { customElements.define('identicon-svg', HTMLTheElement); }

here

/*@__PURE__*/globalThis.customElements?.define('minidenticon-svg',

@laurentpayot
Copy link
Owner

Hi @Thykof, thank you for this bug report and for the fix idea.

I just released v4.2.1 to fix this issue. Can you tell me if it works for you now?

@Thykof
Copy link
Author

Thykof commented Mar 1, 2024

Thanks a lot, it works!

@Thykof Thykof closed this as completed Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants