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

Error: Failed to execute 'define' on 'CustomElementRegistry': the name "action-handler-clock-weather" has already been used with this registry #409

Open
3 tasks done
Chaoscontrol opened this issue Jul 5, 2024 · 6 comments · May be fixed by #472
Labels
bug Something isn't working

Comments

@Chaoscontrol
Copy link

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser
  • I read the FAQ and the issue I'm having was not mentioned there.

Release with the issue: 2.8.0

Last working release (if known): N/A

Browser and Operating System: Chrome, Windows 11 (unsure why the logs say Windows 10, I don't have any)

Description of problem:

Since updating to HA 2024.7, this error started showing in HA logs. Card seems to work fine in the meantime.

Logger: frontend.js.latest.202407030
Source: components/system_log/__init__.py:333
First occurred: 3 July 2024 at 22:29:13 (13 occurrences)
Last logged: 09:36:28

Uncaught error from Chrome 126.0.0.0 on Windows 10 Error: Failed to execute 'define' on 'CustomElementRegistry': the name "action-handler-clock-weather" has already been used with this registry window.CustomElementRegistry.define (src/scoped-custom-element-registry.js:44:14) /hacsfiles/clock-weather-card/clock-weather-card.js:175:2352
Uncaught error from Chrome 126.0.0.0 on Windows 10 Error: Failed to execute 'define' on 'CustomElementRegistry': the name "action-handler-clock-weather" has already been used with this registry window.CustomElementRegistry.define (src/scoped-custom-element-registry.js:44:14) /hacsfiles/clock-weather-card/clock-weather-card.js:180:2352
Uncaught error from Chrome WebView 126.0.6478.134 on Android 11 Error: Failed to execute 'define' on 'CustomElementRegistry': the name "action-handler-clock-weather" has already been used with this registry window.CustomElementRegistry.define (src/scoped-custom-element-registry.js:44:14) /hacsfiles/clock-weather-card/clock-weather-card.js:180:2352

Javascript errors shown in the web inspector (if applicable):
https://xfiles.s-ul.eu/jqV08zOo

Additional information:

@Chaoscontrol Chaoscontrol added the bug Something isn't working label Jul 5, 2024
@pkissling
Copy link
Owner

hi @Chaoscontrol, does this error occur on a regular basis for you? otherwise i assume i could have happened during after HACS upgrade.

@Chaoscontrol
Copy link
Author

Chaoscontrol commented Jul 31, 2024

hi @Chaoscontrol, does this error occur on a regular basis for you? otherwise i assume i could have happened during after HACS upgrade.

Yes it does. Here the latest occurrences (not showing the full error to keep it clean):

2024-07-30 11:37:51.086 ERROR (MainThread) [frontend.js.latest.202407100] Uncaught error from Chrome 127.0.0.0 on Windows 10
2024-07-30 13:51:45.527 ERROR (MainThread) [frontend.js.latest.202407100] Uncaught error from Chrome 127.0.0.0 on Windows 10
2024-07-30 13:51:49.901 ERROR (MainThread) [frontend.js.latest.202407100] Uncaught error from Chrome 127.0.0.0 on Windows 10
2024-07-30 15:53:28.991 ERROR (MainThread) [frontend.js.latest.202407100] Uncaught error from Chrome 127.0.0.0 on Windows 10
2024-07-30 17:56:25.028 ERROR (MainThread) [frontend.js.latest.202407100] Uncaught error from Chrome 127.0.0.0 on Windows 10
2024-07-30 21:00:16.638 ERROR (MainThread) [frontend.js.latest.202407100] Uncaught error from Chrome WebView 127.0.6533.64 on Android 14
2024-07-30 22:39:01.132 ERROR (MainThread) [frontend.js.latest.202407100] Uncaught error from Chrome WebView 126.0.6478.134 on Android 11
2024-07-31 00:06:13.284 ERROR (MainThread) [frontend.js.latest.202407100] Uncaught error from Chrome 127.0.0.0 on Windows 10
2024-07-31 07:16:14.278 ERROR (MainThread) [frontend.js.latest.202407100] Uncaught error from Chrome WebView 126.0.6478.134 on Android 11
2024-07-31 09:11:47.128 ERROR (MainThread) [frontend.js.latest.202407100] Uncaught error from Chrome 127.0.0.0 on Windows 10
2024-07-31 09:24:49.570 ERROR (MainThread) [frontend.js.latest.202407100] Uncaught error from Chrome 127.0.0.0 on Windows 10
2024-07-31 17:18:22.248 ERROR (MainThread) [frontend.js.latest.202407100] Uncaught error from Chrome 127.0.0.0 on Windows 10

Important to note that lately I have never even opened the single dashboard that has this card. So the error triggers completely unrelated to it being displayed or not.

@daubman
Copy link

daubman commented Aug 21, 2024

Just chiming in since I also frequently get this error (for quite a while now, across various updates) - I just did a few new updates today and was checking logs and figured I'd see if I could find out why this one always shows up - which is how I found this issue:

Logger: frontend.js.modern.202408090
Source: components/system_log/__init__.py:333
First occurred: 4:04:29 PM (1 occurrences)
Last logged: 4:04:29 PM

Uncaught error from Chrome 127.0.0.0 on Mac OS 10.15.7 Error: Failed to execute 'define' on 'CustomElementRegistry': the name "action-handler-clock-weather" has already been used with this registry window.CustomElementRegistry.define (src/scoped-custom-element-registry.js:44:14) /hacsfiles/clock-weather-card/clock-weather-card.js:180:2352

@Chaoscontrol
Copy link
Author

Chaoscontrol commented Aug 30, 2024

Oh. I was expecting this fixed with this new minor release 2.8.4, but it's still happening. :(

@hughc-hub
Copy link

it´s still happening here too.. I don't know if there is anything we could manually do to fix it
thanks

@hughc-hub
Copy link

I'm having this issue to... I don't know how long I've been having it but I realized when I was taking a look to the logs..
It seems to be pretty frecuent in my log.
Always after sort of "Uncaught error " from Safari or iOS access (depending if I was using my Mac or my iPhone to access HA):

2024-10-09 19:19:12.773 ERROR (MainThread) [frontend.js.modern.202410022] Uncaught error from WebKit 605.1.15 on iOS 18.0.1
Error: Failed to execute 'define' on 'CustomElementRegistry': the name "action-handler-clock-weather" has already been used with this registry

2024-10-09 19:25:36.119 ERROR (MainThread) [frontend.js.modern.202410022] Uncaught error from WebKit 605.1.15 on iOS 18.0.1
Error: Failed to execute 'define' on 'CustomElementRegistry': the name "action-handler-clock-weather" has already been used with this registry

2024-10-09 21:15:50.732 ERROR (MainThread) [frontend.js.modern.202410022] Uncaught error from Safari 18.0.1 on Mac OS 10.15.7
Error: Failed to execute 'define' on 'CustomElementRegistry': the name "action-handler-clock-weather" has already been used with this registry

pkissling added a commit that referenced this issue Oct 17, 2024
Fixes #409

Add a check to prevent defining the custom element 'action-handler-clock-weather' multiple times.

* Use `if (!customElements.get('action-handler-clock-weather'))` to check if the custom element is already defined before defining it.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/pkissling/clock-weather-card/issues/409?shareId=XXXX-XXXX-XXXX-XXXX).
@pkissling pkissling linked a pull request Oct 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants