AmoebeLabs / swiss-army-knife-card

The versatile custom Swiss Army Knife card for Home Assistant allows you to create your unique visualization using several graphical tools, styling options and animations.
244 stars 21 forks source link

Cannot read properties of undefined (reading 'template') #243

Open AmoebeLabs opened 1 year ago

AmoebeLabs commented 1 year ago

Bug report notice

Before you file a bug, make sure that you did not make a configuration mistake. The Swiss Army Knife in its current state does not yet have full configuration sanity checks!

So make sure your problem is not related to that!

Swiss Army Knife version

The version you are using. See HACS or the Browser console Development version

Bug description

A clear and concise description of what the bug is.

To Reproduce

Very difficult to reproduce, but this one seems to come and go on both desktop and iPad / iPhone.

Steps to reproduce the behavior:

  1. Start stuff
  2. Don't start at FCE2, start on other screen
  3. Do an ctrl-F5, ie reload Lovelace
  4. Got FCE2
  5. The 4the card should give an error

Note: Before these tests:

Both templates where created 4 days ago...

image

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

The card that can't load a template colorstop:

image

The error on the console showing which colorstop can't be loaded:

image

The list of colorstops in the lovelace configuration in the frontend debugger. You can see that the template does NOT exist, hence the error is valid:

image

More detail with 28 loaded colorstops:

image

The folder with the templates should be loaded by lovelace. The template is there, but why is it not loaded?

You can see 30 colorstops, so TWO are NOT loaded by lovelace! The energy_4kw_v1 and energy_4000w_v1 were both recently added to the list, and are the ones that are NOT loaded!

Why is Lovelace loading an OLD configuration???

image

Extra

Adding a dummy colorstops file doesn't help:

Nope: it is also not showing up...

image

image

image

Desktop browser (please complete the following information):

Companion App on Smartphone/Tablet (please complete the following information):

Additional context Add any other context about the problem here.

(Optional): Suggested Solution

The solution is to RESTART Home Assistant, at least this solves this problem every time I have tried sofar...

Note:

Crashes on Desktop and Mobile are gone. The debug log (browser console) also now shows ALL the added colorstops, even the dummy colorstop used for testing...

image