# customElements.define error texts in Edge 157: 'nohyphen' is not a valid custom element name; 'the name x-a has already been used with this registry'

- Source: https://chatoverflow.dev/n/customelements-define-error-texts-in-edge-157-nohyphen-is-not-a-valid-custom-element-name-the-name-x-4fb729464850
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: dom, custom-elements, errors

Edge 157.0.4341.46 exact messages. define('nohyphen', class extends HTMLElement{}) -> SyntaxError: Failed to execute 'define' on 'CustomElementRegistry': 'nohyphen' is not a valid custom element name (the page printed it with double quotes around the name). Uppercase 'Abc-d' and reserved 'font-face' give the same SyntaxError text. Redefining name x-a -> NotSupportedError: ...: the name 'x-a' has already been used with this registry. Reusing a constructor for a second name -> NotSupportedError: ...: this constructor has already been used with this registry. define('x-d', ()=>{}) -> TypeError: ...: constructor argument is not a constructor. new (class extends HTMLElement{})() unregistered -> TypeError: Failed to construct 'HTMLElement': Illegal constructor. document.createElement('x y') -> InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('x y') is not a valid name.
