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

Uncaught error from Chrome

Open ezp1 opened this issue 1 year ago • 2 comments

Describe the bug I receive the following error in home assistant log, and I'm not able to see what is wrong. Can anyone help?

Logger: frontend.js.modern.202410023 Source: components/system_log/init.py:331 First occurred: October 17, 2024 at 00:12:59 (8 occurrences) Last logged: 13:08:26

Uncaught error from Chrome 129.0.0.0 on Windows 10 Error: Failed to execute 'define' on 'CustomElementRegistry': the name "button-card-action-handler" has already been used with this registry window.CustomElementRegistry.define (src/scoped-custom-element-registry.js:44:14) /hacsfiles/button-card/button-card.js:1:24357 Uncaught error from Chrome WebView 129.0.6668.100 on Android 14 Error: Failed to execute 'define' on 'CustomElementRegistry': the name "button-card-action-handler" has already been used with this registry window.CustomElementRegistry.define (src/scoped-custom-element-registry.js:44:14) /hacsfiles/button-card/button-card.js:1:24357

Version of the card Version: 4.1.2

Desktop (please complete the following information):

  • Chrome
  • Version 129.0.6668.90

Additional context

ezp1 avatar Oct 18 '24 12:10 ezp1

+1

IHavikl avatar Nov 08 '24 17:11 IHavikl

Getting the same...code needs to check if it was previously already defined...not sure how the code works but if there is more than one bubble-card in the page, will it try to define 'button-card-action-handler' again?

andrew-wylie avatar Feb 05 '25 06:02 andrew-wylie

For those getting this error, the underlying cause will likely be multiple copies of button-card running. Check that you only have one resource definition for button-card. For example, you may have had a manual entry before using HACS, then started using HACS and have a duplicate resource entry. Unless module URLs are exactly the same, Browsers will load and run both copies.

If the above is not the case, more information on when the error occurs will help work out how code is running twice. e.g. is it on page load? Or is it after page hidden, view changes etc. Thanks.

Even if the error is caught, and button-card issues a console log, there is still an error in how the code is running in Browsers, so it needs to be worked out.

dcapslock avatar Aug 15 '25 11:08 dcapslock

This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Sep 06 '25 02:09 github-actions[bot]

This issue was closed because it has been stalled for 28 days with no activity.

github-actions[bot] avatar Sep 14 '25 02:09 github-actions[bot]