uxigene / MMM-Chart

Chart module for MagicMirror²
9 stars 9 forks source link

other modules not starting #5

Open wiedsee opened 2 years ago

wiedsee commented 2 years ago

hi,

whenever i activate your module all the other modules keep loding and won't boot

with module enabled image

without module enebled image

{ module: 'MMM-Chart', position: 'top_right', config: { width: 800, height: 800, chartConfig: { type: 'bar', data: { labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'], datasets: [{ label: '# of Votes', data: [12, 19, 3, 5, 2, 3], backgroundColor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(255, 206, 86, 0.2)', 'rgba(75, 192, 192, 0.2)', 'rgba(153, 102, 255, 0.2)', 'rgba(255, 159, 64, 0.2)' ], borderColor: [ 'rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)', 'rgba(75, 192, 192, 1)', 'rgba(153, 102, 255, 1)', 'rgba(255, 159, 64, 1)' ], borderWidth: 1 }] } } } },

`/ global Module /

/* Magic Mirror

Module.register("MMM-Chart", { defaults: { width : 200, height : 200, chartConfig : { } },

getScripts: function() {
    return ["modules/" + this.name + "/node_modules/chart.js/dist/Chart.bundle.min.js"];
},

start: function() {
    this.config = Object.assign({}, this.defaults, this.config);
    Log.info("Starting module: " + this.name);
},

getDom: function() {
    // Create wrapper element
    const wrapperEl = document.createElement("div");
    wrapperEl.setAttribute("style", "position: relative; display: inline-block;");

    // Create chart canvas
    const chartEl  = document.createElement("canvas");        

    // Init chart.js
    this.chart = new Chart(chartEl.getContext("2d"), this.config.chartConfig);

// Set the size
chartEl.width  = this.config.width;
    chartEl.height = this.config.height;
chartEl.setAttribute("style", "display: block;");

    // Append chart
    wrapperEl.appendChild(chartEl);

    return wrapperEl;
}

}); pi@raspberrypi:~/MagicMirror $ npm start

magicmirror@2.18.0 start DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js

[31.07.2022 14:19.56.781] [LOG] Starting MagicMirror: v2.18.0 [31.07.2022 14:19.56.792] [LOG] Loading config ... [31.07.2022 14:19.56.813] [LOG] Loading module helpers ... [31.07.2022 14:19.58.311] [LOG] Initializing new module helper ... [31.07.2022 14:19.58.313] [LOG] Module helper loaded: MMM-BackgroundSlideshow [31.07.2022 14:19.59.837] [LOG] Initializing new module helper ... [31.07.2022 14:19.59.841] [LOG] Module helper loaded: MMM-CalendarExt2 [31.07.2022 14:19.59.849] [LOG] No helper found for module: clock. [31.07.2022 14:19.59.866] [LOG] Initializing new module helper ... [31.07.2022 14:19.59.868] [LOG] Module helper loaded: MMM-MyDutchWeather [31.07.2022 14:20.00.186] [LOG] Initializing new module helper ... [31.07.2022 14:20.00.189] [LOG] Module helper loaded: MMM-rainfc [31.07.2022 14:20.00.269] [LOG] Initializing new module helper ... [31.07.2022 14:20.00.272] [LOG] Module helper loaded: MMM-MyGarbage [31.07.2022 14:20.00.279] [LOG] No helper found for module: MMM-AutoDimmer. [31.07.2022 14:20.00.616] [LOG] Initializing new module helper ... [31.07.2022 14:20.00.619] [LOG] Module helper loaded: MMM-Remote-Control [31.07.2022 14:20.00.626] [LOG] No helper found for module: MMM-Chart. [31.07.2022 14:20.00.628] [LOG] All module helpers loaded. [31.07.2022 14:20.01.029] [LOG] Starting server on port 8080 ... [31.07.2022 14:20.01.041] [WARN] You're using a full whitelist configuration to allow for all IPs [31.07.2022 14:20.01.059] [LOG] Server started ... [31.07.2022 14:20.01.062] [LOG] Connecting socket for: MMM-BackgroundSlideshow [31.07.2022 14:20.01.065] [LOG] Connecting socket for: MMM-CalendarExt2 [31.07.2022 14:20.01.067] [LOG] Connecting socket for: MMM-MyDutchWeather [31.07.2022 14:20.01.069] [LOG] Starting node_helper for: MMM-MyDutchWeather [31.07.2022 14:20.01.072] [LOG] Connecting socket for: MMM-rainfc [31.07.2022 14:20.01.074] [LOG] Connecting socket for: MMM-MyGarbage [31.07.2022 14:20.01.077] [LOG] Starting node_helper for module: MMM-MyGarbage [31.07.2022 14:20.01.079] [LOG] Connecting socket for: MMM-Remote-Control [31.07.2022 14:20.01.081] [LOG] Starting node helper for: MMM-Remote-Control [31.07.2022 14:20.01.248] [LOG] Sockets connected & modules started ... [31.07.2022 14:20.01.593] [LOG] Launching application. [31.07.2022 14:20.04.852] [INFO] BACKGROUNDSLIDESHOW_NEXT_IMAGE [31.07.2022 14:20.04.888] [ERROR] Whoops! There was an uncaught exception... [31.07.2022 14:20.04.905] [ERROR] TypeError: Cannot read property 'imagePaths' of undefined at Class.gatherImageList (/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_helper.js:112:32) at Class.getNextImage (/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_helper.js:145:12) at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_helper.js:298:12) at Socket. (/home/pi/MagicMirror/js/node_helper.js:109:11) at Socket.emit (events.js:200:13) at Socket.emitUntyped (/home/pi/MagicMirror/node_modules/socket.io/dist/typed-events.js:69:22) at /home/pi/MagicMirror/node_modules/socket.io/dist/socket.js:465:39 at processTicksAndRejections (internal/process/task_queues.js:82:9) [31.07.2022 14:20.04.914] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? [31.07.2022 14:20.04.916] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues [31.07.2022 14:20.08.582] [LOG] 200[object Object]`

and i already tryed disabeling MMM-BackgroundSlideshow but that doesnt help either (its also functioning fine)

wiedsee commented 2 years ago

Hi,

i found out that after about 10 minutes of letting magic mirror doing its thing everything came back as normal but it took a long while for all the modules to load.

any idea how i can fix this?

oh and if i do a inspect on crome i get the following error to "Uncaught RangeError: Maximum call stack size exceeded"

thanks alot

uxigene commented 2 years ago

Helo @wiedsee. Tanks for reporting this. Unfortunatelly I had not time to check the issue. It looks like there is infinite loop for some reason. Not sure the issue is caused by this library. I'll check it when have some time. Sorry for that.

wiedsee commented 2 years ago

Helo @wiedsee. Tanks for reporting this. Unfortunatelly I had not time to check the issue. It looks like there is infinite loop for some reason. Not sure the issue is caused by this library. I'll check it when have some time. Sorry for that.

no problem i have the time thanks for the heads up and ill wait patiently for a fix 😊