n8n-io/n8n · error · UnsupportedNodeError

Unsupported syntax: 'Only property assignment (e.g., obj.pro

Error message

Unsupported syntax: 'Only property assignment (e.g., obj.prop = value) is allowed. Variable reassignment is not permitted.' is not allowed in SDK code

What it means

The interpreter only allows property assignment (`obj.prop = value`) where the left side is a `MemberExpression`. Direct variable reassignment (`x = newValue`) is rejected at interpreter.ts:705 because SDK code is designed to be declarative — `const`-only bindings, no mutation of variable bindings themselves. Object property mutation is permitted, but rebinding a name to a new value is not.

Source

Thrown at packages/@n8n/workflow-sdk/src/ast-interpreter/interpreter.ts:706

		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(
				'super keyword is not supported in SDK code',
				node.left.object.loc ?? undefined,
				this.sourceCode,
			);
		}

		const obj = this.evaluate(node.left.object);

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Use a new `const` with a different name for the updated value: `const totalUpdated = total + 1`
  2. If mutating an object property, use `obj.prop = newValue` (property assignment IS allowed)
  3. Move stateful or accumulator logic to a Code node

Example fix

// before
let total = 0;
total = total + 5;

// after
const total = 5;
// or, accumulating on an object (allowed):
const state = {};
state.total = state.total + 5;
Defensive patterns

Strategy: validation

Validate before calling

// Detect variable reassignment (assignment to non-MemberExpression)
function hasVariableReassignment(code: string): boolean {
  const ast = parse(code, { ecmaVersion: 'latest', sourceType: 'module' });
  let found = false;
  walk(ast, (node) => {
    if (
      node.type === 'AssignmentExpression' &&
      node.operator === '=' &&
      node.left.type !== 'MemberExpression'
    ) {
      found = true;
    }
  });
  return found;
}

if (hasVariableReassignment(sdkCode)) {
  // reject — suggest using a new const or property assignment

Try / catch

import { UnsupportedNodeError } from '@n8n/workflow-sdk/ast-interpreter/errors';

try {
  interpretSDKCode(sdkCode, sdkFunctions);
} catch (e) {
  if (e instanceof UnsupportedNodeError && e.message.includes('Variable reassignment')) {
    // suggest using a new const or obj.prop = value pattern
  }
  throw e;
}

Prevention

When it happens

Trigger: Writing `x = 5` where `x` is a variable identifier (not a property access). The check `node.left.type !== 'MemberExpression'` at interpreter.ts:705 fires before any other validation, catching any assignment whose left side is an `Identifier` or other non-member node.

Common situations: Imperative-style code that reuses variable names for different values; accumulator patterns (`total = total + 1`); porting `let`-based loops.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/741da51fa43b20bd. Report an issue: GitHub.