lovelace-auto-reload-card icon indicating copy to clipboard operation
lovelace-auto-reload-card copied to clipboard

Error with HA 2022.03 update

Open Krojack opened this issue 3 years ago • 9 comments

Started getting the following error after updating to the March HA build.

2022-03-03 18:08:05 ERROR (MainThread) [frontend.js.latest.202203010] https://homeassistant.lan:/hacsfiles/lovelace-auto-reload-card/auto-reload-card.js:29:32 Uncaught TypeError: Cannot read properties of null (reading 'querySelector')

Krojack avatar Mar 03 '22 23:03 Krojack

Yep. And it doesn't update lovelace anymore. Please fix it... it's very usefull card.

Protoncek avatar Mar 04 '22 08:03 Protoncek

Temporary fix: In file: auto-reload-card.js replace line: const refresh = buttonMenu.querySelector('[aria-label=Refresh]'); with: const refresh = null;

adamfreefall avatar Mar 08 '22 07:03 adamfreefall

I have the same issue, tried your fix but it did not work for me. Running 2022.6.6 Not sure how long this error has been there.

rjenx avatar Jun 15 '22 08:06 rjenx

will there be a permanent fix?

kwithus avatar Jun 22 '22 07:06 kwithus

Hi, Thanks you for reporting. I don't have enough time right now to investigate and make a fix but if anyone wants to make a PR, I'd be happy to merge it

ben8p avatar Jun 22 '22 07:06 ben8p

Uninstalled the component until a fix is available and still getting the error, I guess somewhere there is residual code.

rjenx avatar Jun 22 '22 09:06 rjenx

I think Lovelace has a cache. You need to refresh it

ben8p avatar Jun 22 '22 10:06 ben8p

Any ideas how you clear this cache?

I used the SSH addon and found the auto-reload-card.js file in config/www/custom_components/lovelace-auto-reload-card/ and I've edited it with the fix above.

I have obviously rebooted and of course cleared the browser local cache.

I can even go to the url of:

http://192.168.100.69:8123/hacsfiles/lovelace-auto-reload-card/auto-reload-card.js

And here I can clearly see the fix mentioned above has not been applied to the expected file.

zSprawl avatar Jul 08 '22 06:07 zSprawl

In the meantime, I was able to copy the file to a location I could reach, change the resource link, and reboot to validate the fix does indeed work.

Also in reflection, I think the error only appeared when the tablet user fires off (which doesn't have admin rights). I don't know if that could be related.

zSprawl avatar Jul 08 '22 06:07 zSprawl