button-card icon indicating copy to clipboard operation
button-card copied to clipboard

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

Open tmchow opened this issue 4 years ago • 8 comments

Checklist

  • [x] I updated the card to the latest version available
  • [x] 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 avatar Jun 04 '21 06:06 tmchow

You have 2 button-card loaded in your resources.

RomRider avatar Jun 04 '21 08:06 RomRider

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

johntdyer avatar Oct 10 '21 17:10 johntdyer

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.

RomRider avatar Oct 11 '21 06:10 RomRider

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 avatar Jan 26 '22 16:01 Pirol62

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

Pirol62 avatar Jan 30 '22 12:01 Pirol62

Hi all. I solved the issue for myself. https://github.com/home-assistant/frontend/issues/11494 I hope it may helps some others as well.

Pirol62 avatar Feb 10 '22 16:02 Pirol62

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

lbouriez avatar Feb 14 '22 14:02 lbouriez

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.

LiivaneLord avatar Jan 06 '24 09:01 LiivaneLord