lovelace-card-mod icon indicating copy to clipboard operation
lovelace-card-mod copied to clipboard

Performance warning is always showing on 2023.4.0b5

Open kulmegil opened this issue 1 year ago • 10 comments

My Home Assistant version: 2023.4.0b5

My lovelace configuration method (GUI or yaml): gui

What I am doing: loading tab

What I expected to happen: Nothing. No bad performance warning in dev console when proper installation procedure is followed

What happened instead: Performance warning is always shown in dev console

Looks like function getResources() from helpers.ts is returning invalid output

Minimal steps to reproduce:

frontend:
  extra_module_url:
    - /hacsfiles/lovelace-card-mod/card-mod.js

Error messages from the browser console: card-mod-performace-warning


By putting an X in the boxes ([]) below, I indicate that I:

  • [x] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).

  • [x] Have made sure I am using the latest version of the plugin.

  • [x] Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.

  • [x] Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

kulmegil avatar Apr 04 '23 22:04 kulmegil

Also on 2023.4.1

ASNNetworks avatar Apr 07 '23 10:04 ASNNetworks

Confirmed, 2023.4.0

ildar170975 avatar Apr 07 '23 13:04 ildar170975

Also on 2023.4.5

nima-1102 avatar Apr 19 '23 19:04 nima-1102

Looks like https://github.com/thomasloven/lovelace-card-mod/blob/b8c48b925643389fea5b1c0185ad7e0cbbd2bb76/src/helpers.ts#L166 is trying to split each script tag's innerText on newline, but that's not how they're formatted anymore:

> document.querySelectorAll("script")[3].innerText.trim()
'import("/hacsfiles/lovelace-card-mod/card-mod.js");import("/local/custom_icons/custom_icons.js");import("/hacsfiles/iconset.js");'

acshef avatar Jun 01 '23 02:06 acshef

From debugging, I'm seeing roughly the same as you @acshef:

"/hacsfiles/lovelace-card-mod/card-mod.jsimport("/hacsfiles/iconset.js");"

Oddly no ;'s between the statements though. I wonder where those imports are coming from.

ScottG489 avatar Jun 20 '23 22:06 ScottG489

Still having this issue

Ali229 avatar Jun 26 '23 16:06 Ali229

Still seeing this issue

johntdyer avatar Sep 24 '23 20:09 johntdyer

+1

Home Assistant 2023.9.3 Supervisor 2023.09.2 Operating System 10.5 Frontend 20230911.0 - latest

nima-1102 avatar Sep 25 '23 09:09 nima-1102

+1 Home Assistant 2023.9.3 Supervisor 2023.09.2 Operating System 10.5 Frontend 20230911.0 - latest

nick-holmquist avatar Sep 26 '23 17:09 nick-holmquist

Is this related to the poor performance as of late? A simple screen tilt triggers an update and brings the card-mod styles. (I'm sorry idk how to debug properly)

https://github.com/thomasloven/lovelace-card-mod/assets/1921626/9ba33d6b-d242-424f-81ae-de5ded60a01a

Siroguh avatar Oct 16 '23 14:10 Siroguh