Potentially broken; will not re-define my custom element
Hello,
I've imported the redefine-custom-elements module and tried to use it with my HMR setup.
Unfortunately, on hot reload, I get this error:
DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "component-name" has already been used with this registry
Does this script still work for others?
Oddly enough, when I slow the execution down and debug through each statement in "redefine-custom-elements", no errors are reported in the console. However, my web component is still not hot-reloaded.
Oddly enough, when I slow the execution down and debug through each statement in "redefine-custom-elements", no errors are reported in the console. However, my web component is still not hot-reloaded.
I've found this script works best when linked in the html <head>. It needs to execute before any components are imported/registered.