FlowiseAI/Flowise · error · Error
${execution.error.name}: ${execution.error.value}
Error message
${execution.error.name}: ${execution.error.value} What it means
Thrown by the Daytona-based sandbox branch of executeJavascript after sbx.runCode returns an execution with a populated execution.error object. The error carries a name and value from the sandboxed runtime — typically a thrown JS error or a compile-time exception inside the user-supplied code string.
Source
Thrown at packages/components/src/utils.ts:1712
// Separate imports from the rest of the code for proper ES6 module structure
const codeWithImports = [
...importLines,
`module.exports = async function() {`,
...variableDeclarations,
...otherLines,
`}()`
].join('\n')
const execution = await sbx.runCode(codeWithImports, { language: 'js' })
let output = ''
if (execution.text) output = execution.text
if (!execution.text && execution.logs.stdout.length) output = execution.logs.stdout.join('\n')
if (execution.error) {
throw new Error(`${execution.error.name}: ${execution.error.value}`)
}
if (execution.logs.stderr.length) {
throw new Error(execution.logs.stderr.join('\n'))
}
// Stream output if streaming function provided
if (streamOutput && output) {
streamOutput(output)
}
// Clean up sandbox
sbx.kill()
return parseOutput(output)
} catch (e) {
throw new Error(`Sandbox Execution Error: ${e}`)
}View on GitHub (pinned to abe4a8601a)
Solutions
- Read execution.error.name + value to identify the exact JS error (e.g. ReferenceError: foo is not defined).
- Test the custom function code in isolation (node REPL or a unit test) with the same input variables.
- Confirm all imported modules are in the allow-list and installed by the sandbox (librariesToInstall).
- Check that flow variables passed into the sandbox match what the code expects.
Example fix
// before
if (execution.error) {
throw new Error(`${execution.error.name}: ${execution.error.value}`)
}
// after — include line/script context to speed debugging
if (execution.error) {
throw new Error(`Sandbox code error — ${execution.error.name}: ${execution.error.value}`, )
}
// caller-side: wrap executeJavascript and prepend the offending code excerpt from the node config Defensive patterns
Strategy: try-catch
Validate before calling
function codeReferencesDefinedVars(code: string, sandboxKeys: string[]): string[] {
const missing: string[] = []
for (const k of sandboxKeys) if (!new RegExp(`\\b${k}\\b`).test(code)) missing.push(k)
return missing
} Type guard
function isExecutionError(exec: any): exec is { error: { name: string; value: string } } {
return exec && typeof exec === 'object' && exec.error && typeof exec.error.name === 'string'
} Try / catch
if (execution.error) {
const e = new Error(`${execution.error.name}: ${execution.error.value}`)
;(e as any).sandboxError = execution.error
throw e
} Prevention
- Lint user code (eslint) before sending it to the sandbox to catch undefined refs.
- Type-check sandbox variables passed into executeJavascript against the code's expectations.
- Surface execution.error.name to the UI so authors can fix the code quickly.
When it happens
Trigger: User code in the tool/custom-function node throws a runtime Error (ReferenceError, TypeError, SyntaxError); a referenced variable is undefined; imported module API used incorrectly; code throws because the sandbox lacks an expected env var or file.
Common situations: Building a Custom Tool function with a bug; referencing a flow variable that doesn't exist; calling a dependency's API with the wrong signature inside the sandbox; SyntaxError from malformed user code that survived the import-stripping preprocessor.
Related errors
- ${execution.logs.stderr.join('\n')}
- Sandbox Execution Error: ${e}
- NodeVM Execution Error: ${e}
- ${e}
- Document object must contain pageContent and metadata
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/0cb2970f2afc7403.
Report an issue: GitHub.