ColinEberhardt/applause-button

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

Opened this issue · 1 comments

Hello. I am using your program well. Your program works fine. However, there is one problem, so I register the issue.

I use applause-buton based on Ghost Blog. I referred to the following site.

Error

I execute Chrome DevTools on my blog and checked the console.

Checked for errors.

Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "applause-button" has already been used with this registry 

image

How i built it

  1. yarn add applause-button
  2. copy js and css in "\node_modules\applause-button\dist"
  3. Add <applause-button style="width: 58px; height: 58px;"/>
  4. gulp build

You'll need to provide more information about how you are using this component (e.g. importing / requiring, or using a script tag in html), and what your gulp build is doing.

Generally this error will occur if you are importing / requiring the same custom element in two different ways, or with two different paths. If you are adding applause-button package via yarn, and including it somewhere in your code, but then additionally including a script tag pointing at a CDN in your page, as described in that blog post you linked to, then you will be registering the component twice. You should do one or the other, not both.