Skip to content

Getting an error after latest HA update these cards are having issues loading #88

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

Open
Shredder5262 opened this issue Mar 19, 2024 · 126 comments

Comments

@Shredder5262
Copy link

Shredder5262 commented Mar 19, 2024

Since the latest HA frontend and supervisor update i am experiencing a lot of errors, one of those things is that the horseshoe cards are not wanting to load when i first navigate to a page on the dashboard, It is not until i refresh that they load. This was not an issue prior to updating.
Strangely one of the cards i had for a PC in my home just disappeared for no reason..there are some other things that have disappeared as well so the disappearance may be related to the update, but just mentioning it here.

I see this error message in the logs.

Logger: frontend.js.latest.202403070
Source: components/system_log/init.py:306
First occurred: 5:13:44 PM (3 occurrences)
Last logged: 9:56:16 PM

Uncaught error from Chrome 122.0.0.0 on Windows 10 TypeError: Cannot read properties of undefined (reading 'substr') FlexHorseshoeCard._colorToRGBA (/hacsfiles/flex-horseshoe-card/flex-horseshoe-card.js:1952:24) FlexHorseshoeCard._getGradientValue (/hacsfiles/flex-horseshoe-card/flex-horseshoe-card.js:1893:33) FlexHorseshoeCard._calculateStrokeColor (/hacsfiles/flex-horseshoe-card/flex-horseshoe-card.js:1822:17) set hass (/hacsfiles/flex-horseshoe-card/flex-horseshoe-card.js:783:29) createCardElement (src/panels/lovelace/cards/hui-stack-card.ts:107:21) createCardElement (src/panels/lovelace/cards/hui-stack-card.ts:124:27) createCardElement (src/panels/lovelace/cards/hui-stack-card.ts:113:13) dispatchEvent (src/common/dom/fire_event.ts:76:7) tag.includes (src/panels/lovelace/create-element/create-element-base.ts:136:14)

@Shredder5262
Copy link
Author

Is this an actively supported project?

@RobertoCravallo
Copy link

Was working fine for me until today. Doesn't load at all anymore. This would be a huge disaster for me, as I know of no other card like this. :-(

@pviegas
Copy link

pviegas commented Apr 12, 2024

Same here. Was ok yesterday. Today is broken.
Says that the custom element does not exist.

@RobertoCravallo
Copy link

RobertoCravallo commented Apr 12, 2024

Says that the custom element does not exist.

Yupp, same here! This would be really bitter, as this is my favorite card and there is nothing even remotely like it!!!!

3ba9677f01cbf70e8c00a350bd632eecb9ba38fe

@MichalSamek
Copy link

Same for me today, Custom element doesnt exist...

@jorritdb
Copy link

Same here, since this morning. A disaster because I use this element heavy in my setup :-(

@cyriax
Copy link

cyriax commented Apr 12, 2024

Getting those messages, if i remember correctly the card already had this problem in the past, with the same behaviour

image

it was solved last time by adding

http:
cors_allowed_origins:
- https://unpkg.com

to the config..sadly not working this time as it seems

@jorritdb
Copy link

Please can you tell me where to put this?? I'm still learning HA...

@koni1980
Copy link

Problem also in other Cards
the url https://unpkg.com/lit-html@%5E1.0.0/lit-html?module is not reachable
grafik

@cyriax
Copy link

cyriax commented Apr 12, 2024

Well, then we'll have to wait :)

@jorritdb
Copy link

Haaaa ok. There is no work around? Why does it needs unpkg.com anyway

@Al-Dek
Copy link

Al-Dek commented Apr 12, 2024

The same: "Custom element doesn't exist: flex-horseshoe-card."
:(

@pulss
Copy link

pulss commented Apr 12, 2024

The same: "Custom element doesn't exist: flex-horseshoe-card."

1 similar comment
@Vlastik123
Copy link

The same: "Custom element doesn't exist: flex-horseshoe-card."

@eddysteurs
Copy link

same for me , did a ha os update yesterday, this monring stopped working (cache renewal?)

@RobertoCravallo
Copy link

RobertoCravallo commented Apr 12, 2024

(cache renewal?)

I think it was the same for me. Only started acting up, after I cleared the cache (which I regularly do).

@Al-Dek
Copy link

Al-Dek commented Apr 12, 2024

(cache renewal?)

I think it was the same for me. Only started acting up, after I cleared the cache (which I regularly do).

What cache you mean? Browser's ? I had cleaned Chrome - no results ...

@RobertoCravallo
Copy link

You misread. It started after cleaning the cache. It is not fixed by cleaning the cache!!!

@Al-Dek
Copy link

Al-Dek commented Apr 12, 2024

Got it. :)

@comazone
Copy link

After update HA operating system all my dashboard with this card crash

@comazone
Copy link

image
image

@RobertoCravallo
Copy link

Let's hope for a fix soon....

@koni1980
Copy link

Problem also in other Cards the url https://unpkg.com/lit-html@%5E1.0.0/lit-html?module is not reachable grafik

Did you read this post?
Thats` the Problem!

@comazone
Copy link

Restore from backup don't help

@andreasbuff
Copy link

andreasbuff commented Apr 12, 2024

Same here, after updateing OS this morning... to 12.2

@RobertoCravallo
Copy link

RobertoCravallo commented Apr 12, 2024

Problem also in other Cards the url https://unpkg.com/lit-html@%5E1.0.0/lit-html?module is not reachable grafik

Cloudflare works just fine for me. I only have issues with the horseshoe-card.

@adnovea
Copy link

adnovea commented Apr 12, 2024

Same here, some JS broken (e.g. flex-horseshoe-card and custom js)
Spend time to backup and trying to fix the issue without success
Too frequent updates may ruin the stability of HA.
[Edit] it's not a HA issue but the unavailability of unpkg called by the add-ons.

@RobertoCravallo
Copy link

Too frequent updates may ruin the stability of HA.

Don't think it does. The stability of HACS repositories is a different matter....

@comazone
Copy link

The card need intrnet resources. It's bad idea

@7xy
Copy link

7xy commented Apr 12, 2024

Consider to now delete all horse shoe cards, as it is not reliable!

@albator49
Copy link

albator49 commented Mar 20, 2025

Good morning. This doesn't work for me. I think it comes from modifying the "flex-horseshoe-card.js" file. Where do you paste the two lines of code?

@mxzy1969
Copy link

new today:

-on Computerscreen is working
-on Home Assistant App Screen (Samsung Android ) nothing, all horseshoe ads disappeared

@bouwerd
Copy link

bouwerd commented Mar 20, 2025

Yes, the fix works on the local computer screen and over the LAN, but not on the Companion app on the mobile phone

@andbad
Copy link

andbad commented Mar 20, 2025

Try to flush app frontend cache: home-assistant/android#5119

By(t)e

@andbad
Copy link

andbad commented Mar 20, 2025

Good morning. This doesn't work for me. I think it comes from modifying the "flex-horseshoe-card.js" file. Where do you paste the two lines of code?

Download this: https://raw.githubusercontent.com/andbad/flex-horseshoe-card/refs/heads/develop/flex-horseshoe-card.js

By(t)e

@bouwerd
Copy link

bouwerd commented Mar 20, 2025

Thx @andbad that steered me in the correct direction. I had to clear the app's storage in Android settings

@RobertoCravallo
Copy link

RobertoCravallo commented Mar 20, 2025

I had to clear the app's storage in Android settings

That worked for 2 days, not anymore.... :-(

Maybe you didn't apply the fix correctly, try rechecking the various steps.
As I wrote repeatedly, I was working with the fix, but after 2 days, no more!!!!!

@JaroslawPrzybyl
Copy link

Yesterday I made update of HA, then everything was working fine. Today from the morning...

Image

I already tried to clear cache etc...

@RobertoCravallo
Copy link

I already tried to clear cache etc...

Does not work for me anymore either...

@andbad
Copy link

andbad commented Mar 20, 2025

I think you not apply correctly the fix.

By(t)e

@albator49
Copy link

Bonjour. Cela ne fonctionne pas. Je pense que cela vient d'une modification du fichier « flex-horseshoe-card.js ». Où coller les deux lignes de code ?

Téléchargez ceci : https://raw.githubusercontent.com/andbad/flex-horseshoe-card/refs/heads/develop/flex-horseshoe-card.js

Octet

Thks. it works

@RipZ
Copy link

RipZ commented Mar 20, 2025

Fix not worked for me :(

@sjoram
Copy link

sjoram commented Mar 20, 2025

I too have the same issue. I already had that fix applied months ago but this morning all my devices are now showing the card does not exist :(

Clearing the cache does not help either.....

@JaroslawPrzybyl
Copy link

Also for me. I have downloaded this lit-core file, removed (by renaming) .gz file:

Image

.js is modified:

Image

Also I modified hacstag in resources, cleared cache in browser, but have still the same error.
As I found in browser console, I have following error:

Image
look at the link: there is "community_plugin", should be just "community", isn't it? Where can I change it?

@andbad
Copy link

andbad commented Mar 20, 2025

I have installed card through HACS, and in browser console I see this
https://xxxxxxxxxxxxxxxxxx/hacsfiles/flex-horseshoe-card/flex-horseshoe-card.js?hacstag=20729272512

Try to

  • remove the custom card
  • reinstall it in HACS
  • download and substitute edited JS file
  • change hacstag
  • clear browser cache

By(t)e

@sjoram
Copy link

sjoram commented Mar 20, 2025

@JaroslawPrzybyl

Your screenshots gave me a clue and I searched the errors in mine.

For whatever reason I was seeing an error now in finding the lit-core.min.js as I had it exactly as you had typed it.

CHATGPT recommended changing the double quotes " to single quotes '......

I did this and hey presto it worked !!! My graphs are back..

Make the change, clear the cache and refresh the browser screen.

Image

@sjoram
Copy link

sjoram commented Mar 20, 2025

@JaroslawPrzybyl

Your screenshots gave me a clue and I searched the errors in mine.

For whatever reason I was seeing an error now in finding the lit-core.min.js as I had it exactly as you had typed it.

CHATGPT recommended changing the double quotes " to single quotes '......

I did this and hey presto it worked !!! My graphs are back..

Make the change, clear the cache and refresh the browser screen.

Image

Update - all my PCs (Chrome browsers) are now back working but my Android and iOS companion apps are not. Do I need to clear something similar to a cache here does anybody know?

Cheers

@andbad
Copy link

andbad commented Mar 20, 2025

@JaroslawPrzybyl
Your screenshots gave me a clue and I searched the errors in mine.
For whatever reason I was seeing an error now in finding the lit-core.min.js as I had it exactly as you had typed it.
CHATGPT recommended changing the double quotes " to single quotes '......
I did this and hey presto it worked !!! My graphs are back..
Make the change, clear the cache and refresh the browser screen.
Image

Update - all my PCs (Chrome browsers) are now back working but my Android and iOS companion apps are not. Do I need to clear something similar to a cache here does anybody know?

Cheers

You need to clear companion app frontend cache:
home-assistant/android#5119

By(t)e

@sjoram
Copy link

sjoram commented Mar 20, 2025

You need to clear companion app frontend cache: home-assistant/android#5119

By(t)e

Great - found that on iOS and it worked! Graphs working there now!

@mxzy1969
Copy link

WORKS !!!

android app cache clear: How to clear app cache and data?

Open Settings.
Scroll down and select Apps.
Tap the See all option at the bottom.
Tap the app name whose app cache you want to clear.
Tap Storage and cache.
Select Clear cache.
Tap Clear storage to clear data and cache.

https://www.androidpolice.com/clear-app-cache-data-android/

@jakeycrx
Copy link

This is the fix

#88 (comment)

@sjoram
Copy link

sjoram commented Mar 20, 2025

This has not worked for many people in the last 24 hours. Something has changed somewhere in the chain. I have had this fix implemented for many weeks and it was fine but not today. However quoting the lit file in single rather than double quotes made it work again.

@JaroslawPrzybyl
Copy link

JaroslawPrzybyl commented Mar 21, 2025

Unfortunately in my case it still doesn't work (both on the web and android app, the same behaviour), on my web page when I check the console, I still have an error:

Image

My file is in this place: \<my_host>\config\www\community\flex-horseshoe-card

I changed quotes to single, cleared cache, even rebooted whole HA, no difference. Question: could any of you check resources (Settings → Dashboards → Resources ( click the top-right corner 3 dots)) and show me what is visible after filtering 'horseshoe'? Have you changed anything here?

Image

@jakeycrx
Copy link

jakeycrx commented Mar 21, 2025

This is what I have that is working for me:

Image

Image

Have you deleted flex-horseshoe-card.js.gz?

Image

@Al-Dek
Copy link

Al-Dek commented Mar 21, 2025

Works perfect.

/hacsfiles/flex-horseshoe-card/flex-horseshoe-card.js?hacstag=20729272512

Image

@sjoram
Copy link

sjoram commented Mar 21, 2025

I have exactly the same as Jakeycrx and it works.

I see you are using https: but I am just http:. Could that be anything to do with it?

Image

@JaroslawPrzybyl
Copy link

JaroslawPrzybyl commented Mar 21, 2025

Problem solved. It seems that in my case something is wrong with the mapping of the /hacsfiles/ path. I started manually checking links by opening them in browser. This one was fine:

//[host]/local/community/flex-horseshoe-card/lit-core.min.js

and this one, which I had configured in resources - not

//[host]/hacsfiles/flex-horseshoe-card/lit-core.min.js

So I simply edited my Resources, replacing /hacsfiles/ with the full path. After saving, everything started working.
My current resources:

Image

Today, I was close to completely removing this component as the most problematic one in my HA. Fortunately, I decided to give it one last chance. And voilà :)

Image

@aldoagosta
Copy link

LIT-ELEMENT installed locally is for me the most perennial solution. Here is below how I solved it - if it also works for you, thanks to report .
Lit-element module need to be installed with NPM but fortunately there is a bundle version. This facilitate the workaround for us. Download the LIT core file (see note) and renamed it as lit-element.js. Create a folder named lit-element under the Flex-Horseshoe-Card directory config\www\community\flex-horseshoe-card and put this new lit-element.js file in it. If it doesn't work, log again and clear the browser cache.
I also made it works for my other custom add-on using :

//import { LitElement, html, css, svg } from "https://unpkg.com/[email protected]/lit-element.js?module";
import { LitElement, html, css, svg } from "./lit-element/lit-element.js";

NOTE: There are 2 versions available V2 and V3. The link above points to V3 but you can also try the V2.

Just simplify the action:

  1. Download the LIT core file (see note) and put it under the Flex-Horseshoe-Card directory /homeassistant/www/community/flex-horseshoe-card/lit-core.min.js
  2. Modify /homeassistant/www/community/flex-horseshoe-card/flex-horseshoe-card.js
//import { LitElement, html, css, svg } from "https://unpkg.com/[email protected]/lit-element.js?module";
import { LitElement, html, css, svg } from "./lit-core.min.js";
  1. Delete flex-horseshoe-card.js.gz in /homeassistant/www/community/flex-horseshoe-card/
  2. Force update in hacs resource:
  • Open Settings → Dashboards → Resources ( click the top-right corner 3 dots)
  • Modify hacstag/hacsfiles/flex-horseshoe-card/flex-horseshoe-card.js?hacstag=20729272514

Worked for me also changing double quotation marks (") to single one (') here: from "./lit-element/lit-element.js".
Restarted the HA and cleared the cache. The only difference I see is in the hacstag. mine ends with 2 rather than 4 -> `/hacsfiles/flex-horseshoe-card/flex-horseshoe-card.js?hacstag=20729272512

How to clear the cache: https://community.home-assistant.io/t/how-to-clear-the-frontend-cache/670491

Thank you

AA

@andbad
Copy link

andbad commented Mar 21, 2025

Worked for me also changing double quotation marks (") to single one (') here: from "./lit-element/lit-element.js".
Restarted the HA and cleared the cache. The only difference I see is in the hacstag. mine ends with 2 rather than 4 -> `/hacsfiles/flex-horseshoe-card/flex-horseshoe-card.js?hacstag=20729272512

the hacstag is completely arbitrary, you can put any value you want, as long as it is different from the previous one.

By(t)e

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