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

Resource name conflict with "weather-card" #138

Closed
elemakil opened this issue Mar 9, 2024 · 0 comments · Fixed by #144
Closed

Resource name conflict with "weather-card" #138

elemakil opened this issue Mar 9, 2024 · 0 comments · Fixed by #144
Assignees
Labels
bug Something isn't working

Comments

@elemakil
Copy link

elemakil commented Mar 9, 2024

Describe the bug
I am a long timer user of Bram Kragten's weather-card and have recently added this plugin (weather-chart-card) to my Home Assistant installation. When I attempt to edit an existing weather-card or create a new weather-card, the visual editor for weather-card does not show up an I receive the following error (screenshot further below):

Configuration errors detected:
Failed to execute 'define' on 'CustomElementRegistry': the name "weather-card-editor" has already been used with this registry

At the same time, visual editor for weather-chart-card works fine. Removing weather-chart-card (and restarting Home Assistant) resolves the issues for weather-card. It appears like the two plugins are in conflict.

I performed a recursive search on the custom_components directory and as can be expected both weather-card and weather-chart-card register their visual editor using the key "weather-card-editor".

I assume that whether this bug affects weather-card or weather-chart-card depends on the plugin load order which may not be deterministic which would imply that this bug can manifest differently (i.e. the bug might disable weather-chard-card's editor instead).

I am filing this as a bug to weather-chart-card since weather-card is older and therefore, in a sense, "owns" this visual editor key ;-)

To be honest, the real solution would be to not have a global registry of visual editors in Home Assistant, but this is out of scope for this bug report. I suggest to either modify the key used by weather-chart-card to something more unique to this plugin or at least document the incompatibility somewhere in this plugins documentation.

To Reproduce
Steps to reproduce the behavior:

  1. Install weather-card
  2. Install weather-chart-card
  3. Attempt to visually configure both cards

Expected behavior
Visual editor should work for both cards.

Screenshots
image

Desktop (please complete the following information):

  • weather-card version 1.5.0, installed using HACS
  • weather-chart-card version 2.4.2, installed using HACS
  • Home Assistant 2024.03 (using HASS)
  • OS: Windows, Android
  • Browser: Firefox, Firefox Mobile, Android App

Additional context
n/a

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.

2 participants