Closed scstraus closed 4 years ago
I didn't ever get this error, but just upgraded to 0.86.1 and have got it quite a few times now.
Me too after upgrading to 0.86.1
Same
since 0.86.1 sometimes the card dissapears from lovelace ui
Having the same issue since 0.86.1
Me too. Happened as well after the 86.1 update.
It's not random for me. I have calendar card on a view that is not the first one. If I open the GUI it never happens since moment loads before the card since to view the card I need to go to another view. If I refresh the browser when I'm in the view that has the calendar card it ALWAYS fails now.
is this still maintaned?
where do you guys have the js file?
i just changed it from /local to
url: /local/custom_ui/calendar-card/calendar-card.js?v=4
and it seems to have non more issues, for now
where do you guys have the js file? i just changed it from /local to
url: /local/custom_ui/calendar-card/calendar-card.js?v=4
and it seems to have non more issues, for now
Hi def,
I have it stored the same place as where you have changed it to:
url: /local/custom_ui/calendar-card/calendar-card.js?v=1.0.1
The thing I don't understand is your version? I never saw an update with my custom updater and it doesn't look like the js file has been updated lately here on github?
just to made sure i never messed up i have put a random number on it, you may try aswell
Yeah why not. Will give it a try. Just weird that if I set another page or move the calendar card to another tab, then I don't get the error, because the moment file will be loaded before it gets called by the calendar card...
That's still my problem. Refreshing page with calendar-card on it never works.
Solved it (brute force). Change the set hass function in to these 2 funcs.
set hass(hass) {
this._hass = hass;
if (!this.content) {
const card = document.createElement('ha-card');
card.header = this.config.name;
this.content = document.createElement('div');
this.content.style.padding = '0 16px 16px';
card.appendChild(this.content);
this.appendChild(card);
}
this.init();
}
init() {
if(typeof(moment) == "undefined") {
setTimeout(() => this.init(), 200);
return;
}
moment.locale(this._hass.language);
this
.getAllEvents(this.config.entities)
.then(events => this.updateHtmlIfNecessary(events))
.catch(error => console.log('error', error));
}
Do you have moments js higher then the card module? I do...
On Wed, 30 Jan 2019, 21:58 YoinkZed <notifications@github.com wrote:
Yeah why not. Will give it a try. Just weird that if I set another page or move the calendar card to another tab, then I don't get the error, because the moment file will be loaded before it gets called by the calendar card...
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rdehuyss/homeassistant-lovelace-google-calendar-card/issues/23#issuecomment-459106228, or mute the thread https://github.com/notifications/unsubscribe-auth/AJdU24GYbBoXFLU7zuGaH66vE6elIO95ks5vIgd5gaJpZM4aJIKp .
Where have you 'downloaded' the moments file from? I think I still use the one that is on this git repo/or the one that are in the link.
set hass(hass) {
In what file did you made the change, i tought my problems were away but still having the issue, or upload the file file? thnx
In the calendar-card file. Code is above and there's also a pull request pending with my change. You can just copy it.
@yosilevy, thanks! I've used your solution successfully to solve this error in another HA-card.
This cars s is no longer supported so I’m closing
Sometimes randomly I get this error in the log and Calendar card decides not to load. Any idea why?
https://MYHOST:8123/local/custom_ui/calendar-card/calendar-card.js?v=1.0.1:10:7 Uncaught ReferenceError: moment is not defined
A lot of times it works fine, but sometimes it does that.