mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
🐛 Fix bug with external modules on Function-Nodes
This commit is contained in:
parent
31b210f596
commit
5a2f2ee8d1
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue