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

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

Open
Shredder5262 opened this issue Mar 19, 2024 · 73 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!

@RobertoCravallo
Copy link

RobertoCravallo commented Apr 12, 2024

Wow, never thought to look! Big thanks to down-under....

@comazone
Copy link

comazone commented Apr 12, 2024

The culprit seems to be unpkg website that is offline if possible, may be a local install of the code ([email protected]) would be preferable in the future

How i can do it ? What is this "([email protected])"

@pviegas
Copy link

pviegas commented Apr 12, 2024

Screenshot_2024-04-12-20-46-11-26

That’s from 2023. Tricked me to 😋

@RobertoCravallo
Copy link

That’s from 2023. Tricked me to 😋

Darn, so why did he post it? Fake news....

@JaroslawPrzybyl
Copy link

Maybe just the same or similar issue?
Here is the current status:
https://community.fly.io/t/fly-app-servers-down/19229/42

@andreasbuff
Copy link

Hi, this does not solve the problem, but

  • just download V1.1 from HACS again, then the gauges are displayed correct (V1.1.) until the problem with 1.2 has been solved :-)

@jorritdb
Copy link

This fork works!

https://github.com/imval/flex-horseshoe-card

@Al-Dek
Copy link

Al-Dek commented Apr 12, 2024

Works.
But somehow it bothers me...

@jorritdb
Copy link

Much better, it does not pull from internet anymore:

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

@bazzio68
Copy link

This fork works!

https://github.com/imval/flex-horseshoe-card

Thanks, just replaced the flex-horseshoe-card.js file with this new one and it works!

@JaroslawPrzybyl
Copy link

Version 1.2 seems to be working now:
image

@marwonn
Copy link

marwonn commented Apr 12, 2024

It is now working again without any intervention. At least on my site...
I pulled the developer release.

@gritaro
Copy link

gritaro commented Apr 13, 2024

It is now working again without any intervention. At least on my site... I pulled the developer release.

This was a very bad experience.
lit-element.js must be included as a local file.

@marwonn
Copy link

marwonn commented Apr 13, 2024

It is now working again without any intervention. At least on my site... I pulled the developer release.

This was a very bad experience.

lit-element.js must be included as a local file.

You're absolutely right.

@adnovea
Copy link

adnovea commented Apr 13, 2024

It is now working again without any intervention. At least on my site... I pulled the developer release.

This was a very bad experience.
lit-element.js must be included as a local file.

You're absolutely right.

+1

I tried to add the lit-element and lit-html folders but it does not work.
Something is missing : lit-css ?? how to handle SVG ??

@caitotheonlypotato
Copy link

caitotheonlypotato commented Apr 13, 2024

It is now working again without any intervention. At least on my site... I pulled the developer release.

This was a very bad experience.
lit-element.js must be included as a local file.

You're absolutely right.

+1

I tried to add the lit-element and lit-html folders but it does not work. Something is missing : lit-css ?? how to handle SVG ??

did you look at this fork?
https://github.com/imval/flex-horseshoe-card
It seems to have a local implementation of lit-element

@RobertoCravallo
Copy link

RobertoCravallo commented Apr 14, 2024

Stupid question, but I don't know how to use/implement a "fork"....

@Al-Dek
Copy link

Al-Dek commented Apr 14, 2024

Stupid question, but I don't know how to use/implement a "fork"....

HACS > 3 dots in top right corner > Custom repositories > Repository "https://github.com/imval/flex-horseshoe-card" , Category "Lovelace" > Add.

@RobertoCravallo
Copy link

Does not work. I get a "No manifest.json file found 'manifest.json'"

@adnovea
Copy link

adnovea commented Apr 14, 2024

Al-Dek: THX for the installation details.

l'add-on s'installe mais ne fonctionne pas !

In flex-horseshoe-card.js I can see the line : from "./lit-element/lit-element.js"
but there is no folder lit-element under www/community/flex-horseshoe-card.
Where is the lit-element folder and how can the card can found it ? that's a mystery for me.

@RobertoCravallo
Copy link

Got it installed, but then I have the error of it not working again....

@Al-Dek
Copy link

Al-Dek commented Apr 14, 2024

I have the initial version "https://github.com/AmoebeLabs/flex-horseshoe-card", and it works well.
The "imval" version "https://github.com/imval/flex-horseshoe-card" doesn't (with and without local "lit-element" and "lit-html" folders.
So ...as is...

@RobertoCravallo
Copy link

Same here...

@adnovea
Copy link

adnovea commented Apr 15, 2024

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.

@RobertoCravallo
Copy link

Hi adnovea,

I do not understand how to implement this. I copied the JS into the lit-element directory. But how does horseshoe know to use this? I do not understand at all, what "bundle version" has to do with this.

How do I use the "import" function and what exactly does it do?

Thank you from Germany

@adnovea
Copy link

adnovea commented May 6, 2024

Change the corresponding line in config\www\community\flex-horseshoe-card\flex-horseshoe-card.js file.
Here is below the first lines of the file where you can see the previous link (commented) and the local one:

/*
*
* Card      : flex-horseshoe-card.js
* Project   : Home Assistant
* Repository: https://github.com/AmoebeLabs/
*
* Author    : Mars @ AmoebeLabs.com
* 
* License   : MIT
*
* -----
* Description:
*   The Flexible Horseshoe Card.
*
* Refs:
*   - https://github.com/AmoebeLabs/flex-horseshoe-card
*   
*******************************************************************************
*/

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

  console.info(
...

@RobertoCravallo
Copy link

I added a ";" to the end of the line, is that correct?

} from "./lit-element/lit-element.js";

Restarted HA and everything works as before. So seems like a good fix. Thank you for your input!!

@abu9
Copy link

abu9 commented Jun 3, 2024

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

@GreyEarl
Copy link

@abu9 Thanks man! Well written, that worked perfectly.

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