n8n-io/n8n · error · UnsupportedNodeError

Unsupported syntax: 'Object key type ${prop.key.type}' is no

Error message

Unsupported syntax: 'Object key type ${prop.key.type}' is not allowed in SDK code

What it means

In an object literal `{ key: value }`, keys must be an `Identifier` (`{ name: x }`), a string `Literal` (`{ "name": x }`), or a numeric `Literal` (`{ 0: x }`). Computed keys (`{ [expr]: value }`) and other key node types are rejected at interpreter.ts:375 because dynamic property names could construct dangerous keys at runtime.

Source

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

		for (const prop of node.properties) {
			if (prop.type === 'SpreadElement') {
				// Handle spread: { ...obj }
				const spreadValue = this.evaluate(prop.argument);
				if (spreadValue && typeof spreadValue === 'object') {
					Object.assign(result, spreadValue);
				}
			} else if (prop.type === 'Property') {
				// Get key
				let key: string;
				if (prop.key.type === 'Identifier') {
					key = prop.key.name;
				} else if (prop.key.type === 'Literal' && typeof prop.key.value === 'string') {
					key = prop.key.value;
				} else if (prop.key.type === 'Literal' && typeof prop.key.value === 'number') {
					key = String(prop.key.value);
				} else {
					throw new UnsupportedNodeError(
						`Object key type ${prop.key.type}`,
						prop.key.loc ?? undefined,
						this.sourceCode,
					);
				}

				// Get value (handle shorthand: { name } === { name: name })
				const value = this.evaluate(prop.value as ESTree.Expression);
				result[key] = value;
			}
		}

		return result;
	}

	/**
	 * Visit an array expression.
	 */

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Use static string or identifier keys: `{ myKey: value }` or `{ 'my-key': value }`
  2. If the key name must be dynamic, build the object in a Code node and pass the result
  3. Assign properties one at a time on a `const` object (property assignment IS allowed: `obj.field = value`)

Example fix

// before
const obj = { [dynamicKey]: value };

// after
const obj = {};
obj[dynamicKey] = value; // note: this is ALSO blocked if dynamicKey is non-literal
// Best: use a static key
const obj = { fixedKey: value };
Defensive patterns

Strategy: validation

Validate before calling

// Detect computed object keys in object literals
function hasComputedObjectKey(code: string): boolean {
  const ast = parse(code, { ecmaVersion: 'latest', sourceType: 'module' });
  let found = false;
  walk(ast, (node) => {
    if (
      node.type === 'Property' &&
      node.computed
    ) {
      found = true;
    }
  });
  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('Object key type')) {
    // instruct user to use static identifier or literal keys
  }
  throw e;
}

Prevention

When it happens

Trigger: Writing `{ [computedKey]: value }` or `{ [Symbol.iterator]: fn }` in SDK code. At interpreter.ts:368-379, the key must be `Identifier`, string `Literal`, or number `Literal`; a computed property (`[expr]`) produces a different check path and lands in the `else` throw.

Common situations: Using computed/esoteric property keys; Symbol keys; porting code that builds objects with dynamic field names.

Related errors


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