n8n-io/n8n · error · UserError

${flagName} must contain at least one property name.

Error message

${flagName} must contain at least one property name.

What it means

Thrown by parseCredentialProperties when `--include` or `--exclude` is passed but, after splitting on commas and trimming, no non-empty property names remain. e.g. `--include=,,,` or `--include=,, , `.

Source

Thrown at packages/cli/src/commands/import/credentials.ts:402

				return filteredCredential;
			}),
		);
	}

	private parseCredentialProperties(
		value: string | undefined,
		flagName: '--include' | '--exclude',
	) {
		if (!value) return undefined;

		const propertyCandidates = value.split(',');
		const trimmedProperties = propertyCandidates.map((property) => property.trim());
		const nonEmptyProperties = trimmedProperties.filter(Boolean);
		const uniqueProperties = Array.from(new Set(nonEmptyProperties));

		if (uniqueProperties.length === 0) {
			throw new UserError(`${flagName} must contain at least one property name.`);
		}

		return uniqueProperties;
	}

	private warnOnUnknownProperties(
		properties: string[] | undefined,
		knownProperties: Set<string>,
		flagName: '--include' | '--exclude',
	) {
		if (!properties?.length) return;

		const unknownProperties = properties.filter((property) => !knownProperties.has(property));
		if (unknownProperties.length === 0) return;

		this.logger.warn(
			`Ignoring unknown properties from ${flagName}: ${unknownProperties.join(', ')}`,
		);

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Provide at least one valid property name: `--include=id,name,data`.
  2. Drop the flag entirely if you don't want to filter properties.

Example fix

// before
n8n import:credentials --input=f.json --include=,,
// after
n8n import:credentials --input=f.json --include=id,name
Defensive patterns

Strategy: validation

Validate before calling

function parseFlag(value: string | undefined, name: string): string[] | undefined {
  if (!value) return undefined;
  const unique = Array.from(new Set(value.split(',').map(s => s.trim()).filter(Boolean)));
  if (unique.length === 0) throw new Error(`${name} needs at least one property name`);
  return unique;
}
const include = parseFlag(flags.include, '--include');

Prevention

When it happens

Trigger: `n8n import:credentials --input=f.json --include=,,,` or `--exclude=" "`. The split+trim+filter(Boolean) pipeline at credentials.ts:396-398 yields an empty array.

Common situations: Whitespace-only flag value; trailing commas; copy-paste from a templated command with placeholder commas.

Related errors


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