From d49c7b781a5c1473cee3aabb8002164b87d77bc7 Mon Sep 17 00:00:00 2001 From: bugsounet Date: Sat, 5 Oct 2024 11:09:18 +0200 Subject: [PATCH 1/2] add try / catch on mode_helper loading --- CHANGELOG.md | 1 + js/app.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce55b0228d..c5298815ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ _This release is scheduled to be released on 2025-01-01._ ### Fixed - [updatenotification] Fix pm2 using detection when pm2 script is in MagicMirror root folder (#3576) +- [core] Fix loading node_helper of modules: avoid black screen, display errors and continue loading with next module (#xxxx) ## [2.29.0] - 2024-10-01 diff --git a/js/app.js b/js/app.js index 8ae002e9f0..5ab23356ee 100644 --- a/js/app.js +++ b/js/app.js @@ -197,7 +197,13 @@ function App () { // if the helper was found if (loadHelper) { - const Module = require(helperPath); + let Module; + try { + Module = require(helperPath); + } catch (e) { + Log.error(`Error when loading ${moduleName}:`, e.message); + return; + } let m = new Module(); if (m.requiresVersion) { From 67b0b34a2341759895f806561f5eb7fdce5da60f Mon Sep 17 00:00:00 2001 From: bugsounet Date: Sat, 5 Oct 2024 11:21:19 +0200 Subject: [PATCH 2/2] add issue number --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5298815ce..2b9ac1ac53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ _This release is scheduled to be released on 2025-01-01._ ### Fixed - [updatenotification] Fix pm2 using detection when pm2 script is in MagicMirror root folder (#3576) -- [core] Fix loading node_helper of modules: avoid black screen, display errors and continue loading with next module (#xxxx) +- [core] Fix loading node_helper of modules: avoid black screen, display errors and continue loading with next module (#3578) ## [2.29.0] - 2024-10-01