1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

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

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;