From 68769913b47ad3f6b8ea7d2cdf22f4c9774f269b Mon Sep 17 00:00:00 2001 From: Timur Shemsedinov Date: Tue, 7 Apr 2026 17:36:06 +0300 Subject: [PATCH] Log error messages on loading modules --- lib/deps.js | 4 ++-- lib/worker.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/deps.js b/lib/deps.js index d6807a33..eafc2cd6 100644 --- a/lib/deps.js +++ b/lib/deps.js @@ -78,9 +78,9 @@ for (const name of dependencies) { } else { lib = loadModule(name); } - } catch { + } catch (error) { if (npmpkg.includes(name) || !optional.includes(name)) { - notLoaded.add(name); + notLoaded.add(`- ${name}: ${error.stack}`); } continue; } diff --git a/lib/worker.js b/lib/worker.js index 744bb91b..46d43270 100644 --- a/lib/worker.js +++ b/lib/worker.js @@ -109,8 +109,8 @@ const init = async () => { if (notLoaded.size > 0) { if (threadId === 1) { - const libs = Array.from(notLoaded).join(', '); - console.error(`Can not load modules: ${libs}`); + const libs = Array.from(notLoaded).join('\n'); + console.error(`Can not load modules:\n${libs}`); } process.exit(0); }