thomasloven / lovelace-card-mod

🔹 Add CSS styles to (almost) any lovelace card
MIT License
1.12k stars 167 forks source link

NotSupportedError: Cannot define multiple custom elements with the same tag name #161

Closed bcutter closed 8 months ago

bcutter commented 2 years ago

My Home Assistant version: 2021.11.5

My lovelace configuration method (GUI or yaml): GUI

What I am doing: Loading a view containing mod-card elements after upgrading to Card-Mod v3.1.1

What I expected to happen: Nothing in HA log

What happened instead: An error is logged to the HA log file

Minimal steps to reproduce:

type: custom:mod-card
...

Error messages from the browser console: This is from HA log file:

Logger: frontend.js.latest.202111090
Source: components/system_log/__init__.py:190
First occurred: 11:05:47 (19 occurrences)
Last logged: 11:49:27

http://ha:8123/hacsfiles/lovelace-card-mod/card-mod.js?hacstag=190927524310:6:32933 NotSupportedError: Cannot define multiple custom elements with the same tag name
http://ha:8123/hacsfiles/lovelace-card-mod/card-mod.js?hacstag=190927524311:6:34168 NotSupportedError: Cannot define multiple custom elements with the same tag name
http://ha:8123/hacsfiles/lovelace-card-mod/card-mod.js?hacstag=190927524311:6:0 NotSupportedError: CustomElementRegistry.define: 'mod-card' has already been defined as a custom element

I am not 100 % sure if this was introduced with card-mod v3.1.x - but I think so.


By putting an X in the boxes ([]) below, I indicate that I:

dsegantx commented 2 years ago

I did remove it from Configuration -> LovelaceDashboards -> Resources and restarted and error went away.

See the other thread however as it's mentioned that it should remain and the error will be handled in a future release (and can be ignored).