mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
🐛 Fix bug with external modules on Function-Nodes
This commit is contained in:
@@ -84,7 +84,7 @@ export class Function implements INodeType {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Execute the function code
|
// Execute the function code
|
||||||
items = (await vm.run(`module.exports = async function() {${functionCode}}()`, './'));
|
items = (await vm.run(`module.exports = async function() {${functionCode}}()`, __dirname));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return Promise.reject(e);
|
return Promise.reject(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export class FunctionItem implements INodeType {
|
|||||||
let jsonData: IDataObject;
|
let jsonData: IDataObject;
|
||||||
try {
|
try {
|
||||||
// Execute the function code
|
// Execute the function code
|
||||||
jsonData = await vm.run(`module.exports = async function() {${functionCode}}()`, './');
|
jsonData = await vm.run(`module.exports = async function() {${functionCode}}()`, __dirname);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return Promise.reject(e);
|
return Promise.reject(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user