The template that this generates will cause browsers that have a native implementation of the custom element spec to throw an error when trying to instantiate an instance of the new custom element using document.createElement("[custom-element-name]").
This is because the shadow root is being build in the constructor. The fix here is to make sure that the generation of child elements (such as the shadow root) happens in the connectedCallback() function.