Environment
MagicMirror² version: 2.37.0
Node version: 26.3.0
npm version: 11.16.0
Platform: Raspberry Pi OS and MacOS
Which start option are you using?
node --run start
Are you using PM2?
Yes
Module
calendar
Have you tried disabling other modules?
Have you searched if someone else has already reported the issue on the forum or in the issues?
What did you do?
When i started up the program on my mirror all of a sudden all modules wouldn't load anymore. I tried disabling all other modules and found that the issue was in the calendar module.
What did you expect to happen?
I expected everything to startup as usually where all modules load.
What actually happened?
When the calendar has no entry for a single day, the while loop in the calendar module does not increment the counter and it gets into an infinite loop. That causes the whole system to become stuck and stop loading the calendar and other modules.
while (daysCollected < this.config.limitDays) {
const dateStr = currentDate.format("YYYY-MM-DD");
// Check if there are events on the currentDate
if (eventsByDate[dateStr] && eventsByDate[dateStr].length > 0) {
// If there are any events today then get all those events and select the currently active events and the events that are starting later in the day.
newEvents.push(...eventsByDate[dateStr].filter((ev) => this.timestampToMoment(ev.endDate).isAfter(moment())));
// Since we found a day with events, increase the daysCollected by 1
daysCollected++; // <---- THIS LINE SHOULD BE OUTSIDE THIS IF STATEMENT
}
// Search for the next day
currentDate.add(1, "day");
}
Additional comments
I have made a fix for this so i will submit this in the coming days when i find the time for it. Should be quite soon since it is only a one line fix.
Participation
Environment
MagicMirror² version: 2.37.0
Node version: 26.3.0
npm version: 11.16.0
Platform: Raspberry Pi OS and MacOS
Which start option are you using?
node --run start
Are you using PM2?
Yes
Module
calendar
Have you tried disabling other modules?
Have you searched if someone else has already reported the issue on the forum or in the issues?
What did you do?
When i started up the program on my mirror all of a sudden all modules wouldn't load anymore. I tried disabling all other modules and found that the issue was in the calendar module.
What did you expect to happen?
I expected everything to startup as usually where all modules load.
What actually happened?
When the calendar has no entry for a single day, the while loop in the calendar module does not increment the counter and it gets into an infinite loop. That causes the whole system to become stuck and stop loading the calendar and other modules.
Additional comments
I have made a fix for this so i will submit this in the coming days when i find the time for it. Should be quite soon since it is only a one line fix.
Participation