Ensure default module export is exposed in Function node

This commit is contained in:
Nick O'Leary 2021-07-20 14:42:43 +01:00
parent 859c0c7f6c
commit b2dc1d8b23
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 1 additions and 1 deletions

View File

@ -307,7 +307,7 @@ module.exports = function(RED) {
var spec = module.module;
if (spec && (spec !== "")) {
moduleLoadPromises.push(RED.import(module.module).then(lib => {
sandbox[vname] = lib;
sandbox[vname] = lib.default;
}).catch(err => {
node.error(RED._("function.error.moduleLoadError",{module:module.spec, error:err.toString()}))
throw err;