n8n-io/n8n · error · UnsupportedNodeError
Unsupported syntax: 'Assignment operator '${node.operator}'
Error message
Unsupported syntax: 'Assignment operator '${node.operator}' is not allowed. Only '=' is permitted.' is not allowed in SDK code What it means
The interpreter only permits simple `=` assignment. Compound assignment operators (`+=`, `-=`, `*=`, `/=`, `%=`, `**=`, `&&=`, `||=`, `??=`, and all bitwise variants) are rejected at interpreter.ts:697 because they combine read-modify-write semantics that the sandbox doesn't track — they would need to read the current binding value, which conflicts with the `const`-only, no-reassignment model.
Source
Thrown at packages/@n8n/workflow-sdk/src/ast-interpreter/interpreter.ts:698
);
}
}
/**
* Visit a conditional expression (ternary).
*/
private visitConditionalExpression(node: ESTree.ConditionalExpression): unknown {
const test = this.evaluate(node.test);
return test ? this.evaluate(node.consequent) : this.evaluate(node.alternate);
}
/**
* Visit an assignment expression.
* Only allows simple property assignment (obj.prop = value).
*/
private visitAssignmentExpression(node: ESTree.AssignmentExpression): unknown {
if (node.operator !== '=') {
throw new UnsupportedNodeError(
`Assignment operator '${node.operator}' is not allowed. Only '=' is permitted.`,
node.loc ?? undefined,
this.sourceCode,
);
}
if (node.left.type !== 'MemberExpression') {
throw new UnsupportedNodeError(
'Only property assignment (e.g., obj.prop = value) is allowed. Variable reassignment is not permitted.',
node.loc ?? undefined,
this.sourceCode,
);
}
validateMemberExpression(node.left, this.sourceCode);
if (node.left.object.type === 'Super') {
throw new UnsupportedNodeError(View on GitHub (pinned to 5ac6606e81)
Solutions
- Expand to explicit form: `obj.prop = obj.prop + 1` instead of `obj.prop += 1`
- Use a new `const` with the computed value: `const total = base + 1`
- Move accumulator logic to a Code node if the pattern is complex
Example fix
// before obj.count += 1; // after obj.count = obj.count + 1;
Defensive patterns
Strategy: validation
Validate before calling
// Detect compound assignment operators
const COMPOUND_OPS = new Set(['+=','-=','*=','/=','%=','**=','<<=','>>=','>>>=','&=','|=','^=','&&=','||=','??=']);
function hasCompoundAssignment(code: string): string[] {
const ast = parse(code, { ecmaVersion: 'latest', sourceType: 'module' });
const found: string[] = [];
walk(ast, (node) => {
if (node.type === 'AssignmentExpression' && COMPOUND_OPS.has(node.operator)) {
found.push(node.operator);
}
});
return found;
} Try / catch
import { UnsupportedNodeError } from '@n8n/workflow-sdk/ast-interpreter/errors';
try {
interpretSDKCode(sdkCode, sdkFunctions);
} catch (e) {
if (e instanceof UnsupportedNodeError && e.message.includes('Assignment operator')) {
// suggest expanding to explicit form: obj.prop = obj.prop + value
}
throw e;
} Prevention
- Only `=` is allowed for assignment
- Expand `x += 1` to `x = x + 1` (but only if x is a property, not a variable)
- Move complex accumulators to a Code node
When it happens
Trigger: Writing `obj.count += 1`, `x *= 2`, `y ??= defaultValue`, or any compound assignment in SDK code. The check `node.operator !== '='` at interpreter.ts:697 catches all compound operators before the left-hand-side type check.
Common situations: Accumulating counters; building up string values; porting imperative JS that uses `+=` for aggregation; shorthand patterns from Code-node JS.
Related errors
- Unsupported syntax: 'Only property assignment (e.g., obj.pro
- Unsupported syntax: 'Destructuring in variable declaration'
- '${name}' is a reserved SDK function name and cannot be used
- Expression nesting too deep (possible cycle in method chain)
- Unknown identifier: '${identifier}' is not defined
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/a8c24fb09402db3b.
Report an issue: GitHub.