Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry' (Polymer 2.0) [closed]
Asked Answered
P

3

15

I'm facing this issue while running polymer init on polymer-cli.

Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry'

Philosophism answered 10/6, 2017 at 9:2 Comment(4)
can you post a bit more info? some code?Agger
@navnit-kapadiya: Please read how to ask a good question and include a minimal reproducible exampleVirtuoso
Please use correct English in the question. It is quite confusing. Although I've answered your question, I still suggest you to improve your question for people to understand.Gymnastics
see answer for the same error at https://mcmap.net/q/486598/-uncaught-domexception-failed-to-execute-39-define-39-on-39-customelementregistry-39-this-name-has-already-been-used-with-this-registryGulick
G
16

Possible reasons:
- Element name starts with uppercase alphabet
- Element name does not have a hyphen in it (Thanks to Margherita Lazzarini)

Long story:
I was working with polymer CLI and when I ran polymer init, among the series of options it asks me, one of them was Main element name for which I entered Polymer-test-element.

It was giving me this error : Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': "Polymer-test-element" is not a valid custom element name

The problem was I had used an uppercase alphabet in the declared element name. So when I replaced 'P' with 'p' it resolved the issue.

Hope this helps you :)

Gymnastics answered 9/2, 2018 at 12:50 Comment(0)
F
15

Probably you have defined a Custom Element without a hypen (-) in its name. See this answer

Forge answered 18/6, 2017 at 7:28 Comment(0)
S
-1

Check your import, maybe you imported an element with e.g.

<link rel="import" href="../../bower_components/iron-icons/av-icons.html">

instead of

<link rel="import" href="../iron-icons/av-icons.html">

which could both be a valid path but the first one got me the DOMException.

Silkweed answered 12/3, 2018 at 12:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.