From 65f08453983b8943c98356dd5e45c22e97fe1599 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Fri, 23 Oct 2020 18:13:13 +0200 Subject: [PATCH] Fix plugin modules not loading Fix the path to plugin modules using the old plugins dir instead of resolving to the actual path of the plugin, which in turn caused no plugin modules to be loaded. --- packages/slave/slave.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/slave/slave.js b/packages/slave/slave.js index 053258db..17c2bc52 100755 --- a/packages/slave/slave.js +++ b/packages/slave/slave.js @@ -384,7 +384,8 @@ class Instance extends link.Link{ // Find plugin modules to patch in let modules = new Map(); for (let [pluginName, plugin] of this.plugins) { - let modulePath = path.join("plugins", pluginName, "module"); + let pluginPackagePath = require.resolve(path.posix.join(plugin.info.requirePath, "package.json")); + let modulePath = path.join(path.dirname(pluginPackagePath), "module"); if (!await fs.pathExists(modulePath)) { continue; }