Closed Thykof closed 3 months ago
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 https://github.com/laurentpayot/minidenticons/blob/73799010a80aeb5d0ee8f5fc1600017ff2489017/minidenticons.js#L41
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?
Thanks a lot, it works!
With react vite application, I got
and
This is because a custom element can only be defined once. A solution would be to do something like:
here https://github.com/laurentpayot/minidenticons/blob/73799010a80aeb5d0ee8f5fc1600017ff2489017/minidenticons.js#L41