You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I create a polymer element without hyphen in its name, an error is raised, but the message is quite obscure... Let's say it does not help the developer.
Please consider updating the message with a more meaningful content.
Steps to Reproduce
Create new element test
Use the element test
Refresh the page
Expected Results
polymer-micro.html:65 Uncaught SyntaxError: Failed to execute 'registerElement' on 'Document': Registration failed for element 'test'. Element name must contain an hyphen: '-'. Example: 'my-test'. See https://www.w3.org/TR/custom-elements/#valid-custom-element-name for reference.
Actual Results
polymer-micro.html:65 Uncaught SyntaxError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'test'. The type name is invalid.
I've had a PR open for 10 months that fixes this and adds some other helpful debugging stuff.
I don't thin the core team is going to add this. But the good news is custom elements v1 has an improved error message when you try to register an element name without a "-". Polymer 2 will be using that updated API.
As Polymer 2 uses the v1 API, this error message is controlled by the spec. If you execute it today, you receive: Failed to execute 'define' on 'CustomElementRegistry': "foo" is not a valid custom element name. If you would like to see a change in this error message, please open an issue on https://github.com/w3c/webcomponents
Description
When I create a polymer element without hyphen in its name, an error is raised, but the message is quite obscure... Let's say it does not help the developer.
Please consider updating the message with a more meaningful content.
Steps to Reproduce
test
test
Expected Results
polymer-micro.html:65 Uncaught SyntaxError: Failed to execute 'registerElement' on 'Document': Registration failed for element 'test'. Element name must contain an hyphen: '-'. Example: 'my-test'. See https://www.w3.org/TR/custom-elements/#valid-custom-element-name for reference.
Actual Results
polymer-micro.html:65 Uncaught SyntaxError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'test'. The type name is invalid.
Browsers Affected
Tested on Chrome
Versions
See also:
divshot/ele-web#22
#1163
The text was updated successfully, but these errors were encountered: