MagicMirror
MagicMirror copied to clipboard
updatenotification module fails to load if any other module throws an error in creating their dom
I've had a broken third party module for several months and didn't realize it; the update was available but because the issue was with creating the dom on initial load we had issues with receiving the required notifications.
I noticed that MODULE_DOM_CREATED
is being sent, but never DOM_OBJECTS_CREATED
, which updatenotification.js relies on
here.
Would it be a feasible replacement for updatenotification to look for the MODULE_DOM_CREATED
notification instead?
Sample of a successful load:
[Info] notificationReceived(): MODULE_DOM_CREATED (MMM-CalendarExt3.js, line 142)
[Info] notificationReceived(): DOM_OBJECTS_CREATED (MMM-CalendarExt3.js, line 142)
Sample of where one of any modules experiences an error during initial dom creation:
[Info] All modules started! (main.js, line 501)
[Info] notificationReceived(): ALL_MODULES_STARTED (MMM-CalendarExt3.js, line 142)
[Warning] [CX3] Module is not prepared yet, wait a while. (MMM-CalendarExt3.js, line 229)
[Error] TypeError: undefined is not an object (evaluating 'this.tasks.items') — MMM-Todoist.js:579
error
[Info] notificationReceived(): MODULE_DOM_CREATED (MMM-CalendarExt3.js, line 142)
[Error] Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'this.tasks.items')
(anonymous function) (MMM-Todoist.js:579)
[Info] notificationReceived(): NEWS_FEED_UPDATE (MMM-CalendarExt3.js, line 142)
Making this change would support the module to raise the flag that updates are available, which actually resolved the error that MMM-Todoist was hitting.