-
Notifications
You must be signed in to change notification settings - Fork 21
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
Cannot read properties of undefined (reading 'templates') #161
Comments
Thank you for creating your first issue for the Swiss Army Knife custom card! |
This kind of problem is related to ressources files, add it directly from the dashboard ressourses can resolve the problem |
@novisys Thanks. |
Have you reffered to this step by step instalation guide ? |
Yes, otherwise I wouldn't be able to see the card at all. |
After upgrading to 2022.8 of HA it worked! So, it appears the backend should be alright... but for some reason... |
That is very weird, as if the backend can’t load the data for some reason. i haven’t found any cause yet. It works on my end, so difficult to reproduce. what kind of hardware are you running? |
Sorry, am on holiday, so spending a lot less time at the computer/phone. I'll get the full list to you soon :-) |
CPU: Intel(R) Pentium(R) CPU G4560 Anything else you need to know? |
@AmoebeLabs I'm running it on docker-compose, if that helps any. Do you have any suggestions on debugging steps? |
I´m having the same issue. |
Same issue here for me too. Really randomly too. I.e. it will start working and then stop again even without making any changes or restarting Home Assistant. |
@mcrummett Did you also install using HACS? |
Same issue here. I installed with according to the hybrid method and tried to go through the tutorials and with the given files. Everything works (e.g. tutorial 1 part 1/2) until I try it with the templates (e.g. tutorial 1 part 3/4). |
So I've tried to "switch" to the fully custom install, but that also doesn't work. I'll leave it for now, and see what's going on later. |
Same problem here with HACS. HASS is installed in VM on unraid. |
I am also experiencing this on 2022.9.7 -- @brhahlen mentioned that this might be related to using a storage mode dashboard, so I converted to yaml mode and loaded the example dashboards and any of the installed views that utilize a template produce the same error, see figure 1. I installed 1.0.0-rc3 via the hacs add-on, originally into a |
Can concur that the issue is related to storage mode. Switching back to storage mode without refreshing (but with restarting HA in another window) ensures that the dashboard also works in the ui controlled dashboard. Since, everything works without a refresh after switching to yaml and back but with a refresh (which probably causes the template files to be re-requested) the broken path becomes evident. |
hi @sfstar, my installation is currently in yaml mode (not storage mode) and the example dashboard screenshots I pasted above are from a yaml mode dashboard, so my experience diverges from your explanation. |
I was able to resolve the template error by going into chrome developer mode and keep fixing the issues as they were identified. Keep in mind that my f12-based errors could be unrelated, but one of these things fixed it:
At this point, I am no longer getting template errors, but I've gotten a separate error that I'll create a new issue for. |
I have the same problems as described here. Installed in storage mode, the cards worked at first, but after restarting HA I got the "Cannot read properties of undefined (reading 'templates')" error. I also noticed that only some of the cards on the "sak-example-dashboard" was working. I tried all the steps posted by @PeterGrace, but that didn't solve the issue for me. The strange thing is that the cards has been working a couple of times, but then the error is back. Edit: My card added via UI before changing sak-example-dashboard.yaml: Example dashboard before changing sak-example-dashboard.yaml: Added an error to the path in sak-example-dashboard.yaml: Stored the file, refreshed Lovelace dashboard, removed the error in the path, stored the file and refreshed Lovelace dashboard: Example dashboard after changing sak-example-dashboard.yaml: My card added via UI after changing sak-example-dashboard.yaml: After another refresh of the dashboard, the errror is back. Edit2: |
Please help the developers. The same problem happened. Performed the installation according to the scheme indicated on the site. Hardware configuration (Windows 10, Chrome). In the configuration file (lovelace, mode: yaml). Here's an observation: I'm using a lovelace created by a graphic editor (not YAML), if I refresh the browser page on the lovelace tab (created by a graphic editor) then an error appears (Cannot read properties of undefined (reading 'templates'), but if I refresh the browser page on the lovelace page created via yaml, and then go to the lovelace (graphic editor) page, then this page displays the information correctly.but it does not work on the mini pc RPI3 ( OS Raspbian) |
I had the same.. reason was that I had this line (from the manual) !include include/sak/sak_templates.yaml I changed that to this: !include lovelace/sak_templates/sak_templates.yaml then it worked. (I got the same error just with reading: state.. but changed the entity in the example to something that existed.. then all was well. |
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!
Bug description
Trying to use cards with the templates, throws the error in the title.
For instance:
Error in console:
To Reproduce
Good question...
I have installed Swiss Army Knife using the "Hybrid HACS" install.
Meaning, installed via HACS, then downloaded the latest zip from GitHub, and unzipped.
Copied all files from
ha-config
to the relevant directories, removing them first, and restarted HA.The dashboard was created via the UI of HA, not sure if that might be the problem, but would expect it to work by configuring via the UI as well.
Different folder structures:
Expected behavior
I expect it to work :)
Screenshots
Desktop browser (please complete the following information):
Companion App on Smartphone/Tablet (please complete the following information):
Additional context
I think that's about it. If you need more information, please let me know.
The text was updated successfully, but these errors were encountered: