mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix: JS Task Runner not having access to Buffer (no-changelog) (#11285)
This commit is contained in:
@@ -181,6 +181,17 @@ export class JsTaskRunner extends TaskRunner {
|
||||
module: {},
|
||||
console: customConsole,
|
||||
|
||||
// Exposed Node.js globals in vm2
|
||||
Buffer,
|
||||
Function,
|
||||
eval,
|
||||
setTimeout,
|
||||
setInterval,
|
||||
setImmediate,
|
||||
clearTimeout,
|
||||
clearInterval,
|
||||
clearImmediate,
|
||||
|
||||
items: inputItems,
|
||||
...dataProxy,
|
||||
...this.buildRpcCallObject(taskId),
|
||||
@@ -188,7 +199,7 @@ export class JsTaskRunner extends TaskRunner {
|
||||
|
||||
try {
|
||||
const result = (await runInNewContext(
|
||||
`module.exports = async function VmCodeWrapper() {${settings.code}\n}()`,
|
||||
`globalThis.global = globalThis; module.exports = async function VmCodeWrapper() {${settings.code}\n}()`,
|
||||
context,
|
||||
)) as TaskResultData['result'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user