If you extend HTMLElement
or any subclass like HTMLDivElement
You also need to register the custom element
class SampleDiv extends HTMLDivElement{
constructor(){
super();
}
}
customElements.define('sample-div', SampleDiv, { extends: 'div' });
See more here:
https://javascript.info/custom-elements