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

Custom element doesn't exist: nhl-card #2

Open
ThatTallGuy21 opened this issue Nov 2, 2023 · 10 comments
Open

Custom element doesn't exist: nhl-card #2

ThatTallGuy21 opened this issue Nov 2, 2023 · 10 comments

Comments

@ThatTallGuy21
Copy link

At some point after updating to 2023.10 I noticed that the custom nhl card no longer loads the lovelace card. Instead it throws an an error "Custom element doesn't exist: nhl-card" despite having and not changing anything mentioned in setup.

Nothing in my config changed and it was previously working for months prior to 2023.10. I just updated to 2023.11 and it's still not working.

I can see the NHL integration used for this card is still pulling in data for my team.

I also completely deleted the lovelace files and custom repository. I then redownloaded and installed everything again as well without any luck.

Screenshot 2023-11-02 125720_NHL_Card

@ThatTallGuy21
Copy link
Author

Anyone else having this problem in 2023.10 or 2023.11?

@gizhola
Copy link

gizhola commented Nov 16, 2023

Same issue here. Its been broken since 2023.10. Well, that's when I first noticed it, when the season started. I was hoping it would get fixed.

@ThatTallGuy21
Copy link
Author

Thanks for the confirmation. Is there anyway to tag or get a hold of the owner in github? I'd just like to know if they're still planning to support the card or not. If not, then I guess I'll need to find an alternative option.

@gizhola
Copy link

gizhola commented Nov 16, 2023

I figured it out.

You need to edit the ha-nhl-card.js file and change the first line to these 2 lines:

import { html } from "https://unpkg.com/[email protected]/lit-html.js?module";
import { LitElement } from "https://cdn.jsdelivr.net/gh/lit/dist@2/core/lit-core.min.js";

Once you've saved it you need to copy the ha-nhl-card.js into the ha-nhl-card.js.gz archive file replacing the one that is in there.

As soon as I did that and reloaded the resources, it works!!!

@ThatTallGuy21
Copy link
Author

Thanks! I guess I'll need to do this since @SimplySyced may have abandoned this project.

@ThatTallGuy21
Copy link
Author

@gizhola, I think I'm doing something wrong. I made the update above in the ha-nhl-card.js. However, do you mean that I'm supposed to copy and paste the entirety of the content found in the ha-nhl-card.js into the ha-nhl-card.js.gz file found in the same folder? I did that, overwriting the only text that was in that file "'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte" with the same content and restarted HA and the card still isn't working. Can you give any help on what you mean for this second and even third step?

@gizhola
Copy link

gizhola commented Nov 21, 2023

@ThatTallGuy21 Make that change to the ha-nhl-card.js and then use a program like 7-zip to open the ha-nhl-card.js.gz archive and copy the modified ha-nhl-card.js file into the archive to overwrite that file.

Once you've done that, reboot your Home Assistant to reload the resources. At least that's what I did.

@ThatTallGuy21
Copy link
Author

@gizhola - That did the trick! Thank you so much! For anyone else that stumbles across this thread, one other thing I had to do was clear my browser's cache and then it started working again.

@gizhola
Copy link

gizhola commented Nov 21, 2023

@ThatTallGuy21 glad you figured it out, and good point about a cache refresh.

@srvoets
Copy link

srvoets commented Dec 8, 2023

@ThatTallGuy21 Make that change to the ha-nhl-card.js and then use a program like 7-zip to open the ha-nhl-card.js.gz archive and copy the modified ha-nhl-card.js file into the archive to overwrite that file.

Once you've done that, reboot your Home Assistant to reload the resources. At least that's what I did.

Thanks for figuring this! Followed these instructions and it worked.

To anyone else: Dont be like me and bash your head into the wall for an hour and it still doesnt work, make sure you clear your cache after loading the new resource!

After clearing cache in dev mode it worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants