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

after upgradeto Home Assistant 2023.4.1 error i.setconfig is not a function #178

Closed
alvinleegit opened this issue Apr 7, 2023 · 22 comments
Labels
bug Something isn't working

Comments

@alvinleegit
Copy link

Screenshot 2023-04-07 123143

@alvinleegit alvinleegit added the bug Something isn't working label Apr 7, 2023
@github-actions
Copy link

github-actions bot commented Apr 7, 2023

Thank you for creating your first issue for the Swiss Army Knife custom card!

@jgatringer
Copy link

exact problem here. please help with a patch.

I made a very big solar-card with the live-state of my house and that card is very important for me. :-(
For the moment i did a downgrade of Homeassistant to 2023-03...

Bildschirmfoto 2023-04-07 um 20 27 50

@jwaz73
Copy link

jwaz73 commented Apr 8, 2023

Same issue here post upgrade to 2023.4.1 (Upgraded from 2023.3.3, skipped 2023.4.0).

Also seeing the following error in the HA core logs:

Logger: frontend.js.latest.202304061
Source: components/system_log/__init__.py:257
First occurred: 22:45:40 (52 occurrences)
Last logged: 22:56:58

http://x.x.x.x:8123/hacsfiles/swiss-army-knife-card/swiss-army-knife-card.js:693:758 TypeError: SwissArmyKnifeCard.lovelace is null
:0:0 ResizeObserver loop completed with undelivered notifications.

@cerebrate
Copy link

cerebrate commented Apr 10, 2023

This and #177 appear to be caused by a change in 2023.4.0 that makes custom-card-tools (which swiss-army-knife-card uses) break. I have a pull request in against custom-card-tools to fix this here:

custom-cards/custom-card-helpers#73

In the meantime, to get swiss-army-knife-card working, you can grab the file from here:

https://raw.githubusercontent.com/cerebrate/custom-card-helpers/master/dist/index.m.js

place it in the www/community/swiss-army-knife-card/ directory under your Home Assistant configuration directory under the name custom-card-helpers.m.js, and then very carefully find the part at the top of swiss-army-knife-card.js in the same directory that reads

import{fireEvent,stateIcon,getLovelace}from"https://unpkg.com/[email protected]/dist/index.m.js?module";

and change that and only that to

import{fireEvent,stateIcon,getLovelace}from"/local/community/swiss-army-knife-card/custom-card-helpers.m.js?module";

Since the browser will use the compressed version of the .js file if it can, after you have edited swiss-army-knife-card.js, delete swiss-army-knife-card.js.gz, and then make a new compressed version of your edited file with

gzip -k swiss-army-knife-card.js

Don't omit the -k, because you need both the .js and the .js.gz there. You'll need to do this any time you edit the .js.

Clear caches, reload resources, refresh, etc., and otherwise do the needful to get your browser to notice the changes, and you should have a working swiss-army-knife-card again.

@tardich
Copy link

tardich commented Apr 11, 2023

Does not work for me... :-(

@RHG2208
Copy link

RHG2208 commented Apr 11, 2023

I'm sorry to say that's not working for me either....

@jgatringer
Copy link

jgatringer commented Apr 11, 2023

I'm sorry to say too. Doesn't work for me.

The new custom-card-helpers.m.js works in the old ha (2023.3.6). But not in the new ha version (2023.4.2)

@gonczil
Copy link

gonczil commented Apr 11, 2023

Unfortunately, I have the same problem. :(

"The new custom-card-helpers.m.js works in the old ha (2023.3.6). But not in the new ha version (2023.4.2)"

@cerebrate
Copy link

Well, that's damned odd, because it's working fine for me in 2023.4.2 right now...

...oh, bugger. Sorry, y'all, I forgot to mention a step. Since the browser will use the compressed version of the .js file if it can, after you have edited swiss-army-knife-card.js, delete swiss-army-knife-card.js.gz, and then make a new compressed version of your edited file with

gzip -k swiss-army-knife-card.js

Don't omit the -k, because you need both the .js and the .js.gz there. You'll need to do this any time you edit the .js.

@gonczil
Copy link

gonczil commented Apr 11, 2023

Solved, 1000 thanks and gratitude!

@RHG2208
Copy link

RHG2208 commented Apr 11, 2023

Works for me too! Thank you very, very much!
Very happy to see my 'under construction' dashboard is back again.

@tardich
Copy link

tardich commented Apr 11, 2023

Worked on my side as well! Thanks a lot for clarifying ! :-)

@jgatringer
Copy link

Thanks a lot. Works for me too!

@joeyjojo747
Copy link

I applied the fix and its working, expect in the companion app in iOS.
Is there something that I need to do to get it to work in the companion app in iOS?

@cerebrate
Copy link

@joeyjojo747

To clear cache in the iOS app the way that makes this fix work, you have to go to

Settings -> Companion App -> Debugging -> Reset frontend cache

If you haven't tried that already, try that, and then reload it. It should work then.

@joeyjojo747
Copy link

@cerebrate that worked.
Thank you!!

@amyvgordon
Copy link

@cerebrate - thanks so much for this! I've followed your instructions all the way through, but I'm coming unstuck at the final gzip step. Any pointers as to how I create the new compressed file?

@stinobook
Copy link

@cerebrate - thanks so much for this! I've followed your instructions all the way through, but I'm coming unstuck at the final gzip step. Any pointers as to how I create the new compressed file?

depends on your HASS installation, but the easiest way is to go into a terminal either via SSH or on your HASS itself and then go to the correct folder.
once there remove the old compressed file and run the gzip -k command to create a new one.

@stgallazzi
Copy link

After update SAK to version v1.0.0-rc.4 the error "i.setconfig is not a function" came back, and the above procedure to solve the problem no longer works.

@stgallazzi
Copy link

Thanks for the reply, but I don't understand what dependency is missing. I use storage mode, and resources were added through U.I.. Before the update it worked perfectly.

@cerebrate
Copy link

I can't repro this, I'm afraid. I just updated to v1.0.0-rc.4 here and it's working fine without having to repeat the procedure.

@AmoebeLabs
Copy link
Owner

This commit: 2219706 should have fixed this problem and is part of release https://github.com/AmoebeLabs/swiss-army-knife-card/releases/tag/v1.0.0-rc.4

So, @cerebrate , Thanks for your efforts! I totally missed that change, as I had a fixed HA version (docker) running. So pulling new versions did not work and I didn't see my own cards failing...

@stgallazzi , did you clear your browser cache? And you should clear the frontend cache in the companion app for this change to get noticed by the mobile app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests