-
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
I get "r.setConfig is not a function after refreshing" page. #206
Comments
Thank you for creating your first issue for the Swiss Army Knife custom card! |
First question: which version of SAK are you running? Furthermore, the errors point to SAK being unable to find the system templates. if (!SwissArmyKnifeCard.lovelace.config.sak_sys_templates) {
console.error('SAK - System Templates reference NOT defined.');
throw Error('card::get styles - System Templates reference NOT defined!');
}
if (!SwissArmyKnifeCard.lovelace.config.sak_user_templates) {
console.warning('SAK - User Templates reference NOT defined. Did you NOT include them?'); These templates should be included in your dashboard.yaml files: For example, # Include custom cards / tools and plugins for lovelace.
#
# resources:
#
# Decluttering Templates
decluttering_templates:
!include lovelace/decluttering_templates/decluttering_templates.yaml
# Swiss Army Knife Templates
#
# The system templates come with the HACS install and can be updated
# with a new release. That part is automatic!
sak_sys_templates:
!include www/community/swiss-army-knife-card/sak_templates.yaml
# The user templates are created by the user, and won't be updated
# with a new release. If changes are required, then the user has to
# update the template configuration files.
sak_user_templates:
!include lovelace/sak_templates/sak_templates.yaml If you use more dashboards, then each dashboard should include these templates... |
I apologize for the late reply. I'm using the latest version which is 2.4.5. It looks like I have misunderstood something in the installation process. Does it need to be a dashboard that is configured using yaml? Right now I'm trying with a UI dashboard and adding the needed resources that way. Could this be the issue? |
I also get this, mostly on mobile clients. A refresh (not hard refresh) usually fixes it. |
It seems there is some timing or alphabetical order issue how Lovelace loads resources needed for SAK. I experimented with changing folder names, and then some of these loading issues completely disappeared. For instance a I should ask the HA devs if they can explain this behavior as maybe this can be fixed. |
So the issue is not on my end? Just want to be sure since I have scratched my head for a while now. |
You should see my forehead and my desk 😄 It was pure coincidence that I found what looks like an ordering and/or chunking problem. And then I decided that the "swatches" folder should be named "color-swatches" or "cswatches". And then suddenly the errors disappeared 😮 So, if you can do the following experiment, we know more. You must have the following folder in your config: Now try the following to find out if alphabetic order is the problem:
See if that helps. Don't forget to clear all caches on mobile and desktop browser, and possibly restart Home Assistant to make sure the new structure is loaded. |
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
I'm getting the error
r.setConfig is not a function
every time I reload the dashboard. If I clear the cache the cards come back but when I refresh normally the error shows up.To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop browser (please complete the following information):
Companion App on Smartphone/Tablet (please complete the following information):
Additional context
Here is some logs that I found in my browser
The text was updated successfully, but these errors were encountered: