Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev console error about "Failed to execute 'define' on 'CustomElementRegistry" #486

Open
2 tasks done
tmchow opened this issue Jun 4, 2021 · 8 comments
Open
2 tasks done
Labels
question Further information is requested

Comments

@tmchow
Copy link

tmchow commented Jun 4, 2021

Checklist

  • I updated the card to the latest version available
  • I cleared the cache of my browser

Describe the bug
Chrome dev console continually complains about this:

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

Version of the card
Version: 3.5.0b1 and 3.4.2

To Reproduce
Have the card installed and just load the homepage.

Screenshots
image

Expected behavior
no console errors

Desktop (please complete the following information):

  • Brave Browser
  • Version 1.26.47
@tmchow tmchow added the bug Something isn't working label Jun 4, 2021
@RomRider RomRider added question Further information is requested and removed bug Something isn't working labels Jun 4, 2021
@RomRider
Copy link
Collaborator

RomRider commented Jun 4, 2021

You have 2 button-card loaded in your resources.

@johntdyer
Copy link

I have the same issue in Chrome, and I checked my resource file and I for sure only have it declared once

lovelace:
  mode: yaml
  resources:
    - url: /hacsfiles/ozw-network-visualization-card/ozw-network-visualization-card.js
      type: module

    - url: /hacsfiles/light-popup-card/light-popup-card.js
      type: module

    - url: /hacsfiles/battery-state-card/battery-state-card.js
      type: module

    # - url: /hacsfiles/hass-custom-light-popup-card/light-popup-card.js
    #   type: module

    - url: /hacsfiles/thermostat-popup-card/thermostat-popup-card.js
      type: module

    - url: /hacsfiles/decluttering-card/decluttering-card.js
      type: module

    - url: /hacsfiles/Homekit-panel-card/homekit-panel-card.js
      type: module

    - url: /hacsfiles/lights-panel-card/lights-panel-card.js
      type: module

    - url: /hacsfiles/slider-button-card/slider-button-card.js
      type: module

    # - url: /hacsfiles/Multiline-Entity-Card/multiline-entity-card.js
    #   type: module

    - url: /hacsfiles/lovelace-card-mod/card-mod.js
      type: module

    - url: /hacsfiles/mini-climate-card/mini-climate-card-bundle.js
      type: module

    - url: /hacsfiles/lovelace-gui-sandbox/gui-sandbox.js
      type: module

    - url: /hacsfiles/lovelace-slider-entity-row/slider-entity-row.js
      type: module

    - url: /hacsfiles/gauge-card/gauge-card.js
      type: module

    # - url: /hacsfiles/synthwave-hass-extras/synthwave-hass-extras.js
    #   type: module

    - url: /hacsfiles/flex-horseshoe-card/flex-horseshoe-card.js
      type: module

    - url: /hacsfiles/unused-card/unused-card.js
      type: module

    - url: /hacsfiles/config-template-card/config-template-card.js
      type: module

    - url: /hacsfiles/fan-control-entity-row/fan-control-entity-row.js
      type: module

    - url: /hacsfiles/lovelace-popup-card/popup-card.js
      type: module

    - url: /hacsfiles/dual-gauge-card/dual-gauge-card.js
      type: module

    - url: /hacsfiles/mini-graph-card/mini-graph-card-bundle.js
      type: module

    - url: /hacsfiles/entity-attributes-card/entity-attributes-card.js
      type: module

    - url: /hacsfiles/bignumber-card/bignumber-card.js
      type: module

    - url: /hacsfiles/roku-card/roku-card.js
      type: module

    - url: /hacsfiles/secondaryinfo-entity-row/secondaryinfo-entity-row.js
      type: module

    - url: /hacsfiles/upcoming-media-card/upcoming-media-card.js
      type: module

    - url: /hacsfiles/username-element/username-element.js
      type: module

    - url: /hacsfiles/ext-weblink/ext-weblink.js
      type: module

    - url: /hacsfiles/state-element/state-element.js
      type: module

    - url: /hacsfiles/vertical-stack-in-card/vertical-stack-in-card.js
      type: module

    - url: /hacsfiles/circle-sensor-card/circle-sensor-card.js
      type: module

    - url: /hacsfiles/group-card/group-card.js
      type: module

    - url: /hacsfiles/text-divider-row/text-divider-row.js
      type: module

    - url: /hacsfiles/mini-media-player/mini-media-player-bundle.js
      type: module

    - url: /hacsfiles/button-card/button-card.js
      type: module

    - url: /hacsfiles/list-card/list-card.js
      type: module

    - url: /hacsfiles/lovelace-auto-entities/auto-entities.js
      type: module

    - url: /hacsfiles/bar-card/bar-card.js
      type: module

    - url: /hacsfiles/simple-weather-card/simple-weather-card-bundle.js
      type: module

    - url: /hacsfiles/lovelace-card-tools/card-tools.js
      type: module

    - url: /hacsfiles/banner-card/banner-card.js
      type: module

    - url: /hacsfiles/lovelace-fold-entity-row/fold-entity-row.js
      type: module

    - url: /hacsfiles/lovelace-layout-card/layout-card.js
      type: module

    - url: /hacsfiles/lovelace-state-switch/state-switch.js
      type: module

    - url: /hacsfiles/air-visual-card/air-visual-card.js
      type: module

    - url: /local/text-element/text-element.js?v=0
      type: module

    - url: /local/custom-weather-card-chart.js
      type: module

    - url: /hacsfiles/light-entity-card/light-entity-card.js
      type: module

    - url: /hacsfiles/thermostat-card/thermostat-card.js
      type: module

    # https://github.com/iammexx/home-assistant-config/blob/master/ui/darksky/README.md
    - url: /local/custom_ui/dark-sky-weather-card.js?v=7.1
      type: module

    - url: /hacsfiles/surveillance-card/surveillance-card.js
      type: module

    - url: '/hacsfiles/garbage-collection-card/garbage-collection-card.js'
      type: module

    - url: /hacsfiles/lovelace-battery-entity-row/battery-entity-row.js
      type: module

    - url: /hacsfiles/Home-Assistant-Mail-And-Packages-Custom-Card/Home-Assistant-Mail-And-Packages-Custom-Card.js
      type: module

    - url: /hacsfiles/rgb-light-card/card.js
      type: js

    - url: /hacsfiles/hass-bha-icons/hass-bha-icons.js
      type: js

    - url:  /hacsfiles/custom-brand-icons/custom-brand-icons.js
      type: js

    - url: /hacsfiles/lovelace-digital-clock/digital-clock.js
      type: module
frontend:
  themes: !include_dir_merge_named ../../themes
  extra_module_url:
    - /hacsfiles/hass-bha-icons/hass-bha-icons.js
    - /hacsfiles/custom-brand-icons/custom-brand-icons.js
    - /hacsfiles/hass-hue-icons/hass-hue-icons.js

@RomRider
Copy link
Collaborator

Then one of the cards you are using is reusing code from button-card without having changed it.

Grep all your cards from your shell and look for button-card-action-handlerin all those files.

@Pirol62
Copy link

Pirol62 commented Jan 26, 2022

I have exactly the same issue with 'mod-card'. I definately haven't declared it twice.
The issue appears in all dashboards.
Searched for mod_card in all my files but havent found an entry. Did you solve the issue?
I'm using edge as browser but it happend in Chrome as well. AFAIK it is anyway the same core.

@Pirol62
Copy link

Pirol62 commented Jan 30, 2022

Hi @johntdyer . Did you solve the issue? If yes, what did you do?
I do not really understand what RomRider wrote.

@Pirol62
Copy link

Pirol62 commented Feb 10, 2022

Hi all. I solved the issue for myself. home-assistant/frontend#11494
I hope it may helps some others as well.

@lbouriez
Copy link

lbouriez commented Feb 14, 2022

Hello,
Having the same issue, double checked ally my custom_components:
image
It's only used in the button-card file.

Edit:
I just found out that it is coming from Dwains_Dashboard :/
image

@LiivaneLord
Copy link

Go to Overview -> Edit dashboard -> Manage dashboards -> Resources. There should be 2 lines. I deleted mine from /hacsfiles folder and kept file in the /local folder.

Idk is it correct, but I have no error anymore and charts are working. Btw, I got this error only with firefox. Chrome or edge didnt cause the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants