affaan-m/ECC · error · Error

Unknown legacy language: ${unknownLegacyLanguages[0]}. Expec

Error message

Unknown legacy language: ${unknownLegacyLanguages[0]}. Expected one of ${listLegacyCompatibilityLanguages().join(', ')}

What it means

Thrown by resolveLegacyCompatibilitySelection() when exactly one language in the normalized list is not a key in LEGACY_LANGUAGE_ALIAS_TO_CANONICAL. Aliases accepted include c, cpp, csharp, fsharp, go, golang, arkts, harmonyos, java, javascript, kotlin, perl, php, python, rails, ruby, rust, swift, typescript. The single-error branch produces a focused message that lists all valid languages.

Source

Thrown at scripts/lib/install-manifests.js:490

  if (target && !SUPPORTED_INSTALL_TARGETS.includes(target)) {
    throw new Error(
      `Unknown install target: ${target}. Expected one of ${SUPPORTED_INSTALL_TARGETS.join(', ')}`
    );
  }

  const legacyLanguages = dedupeStrings(options.legacyLanguages)
    .map(language => language.toLowerCase());
  const normalizedLegacyLanguages = dedupeStrings(legacyLanguages);

  if (normalizedLegacyLanguages.length === 0) {
    throw new Error('No legacy languages were provided');
  }

  const unknownLegacyLanguages = normalizedLegacyLanguages
    .filter(language => !Object.hasOwn(LEGACY_LANGUAGE_ALIAS_TO_CANONICAL, language));

  if (unknownLegacyLanguages.length === 1) {
    throw new Error(
      `Unknown legacy language: ${unknownLegacyLanguages[0]}. Expected one of ${listLegacyCompatibilityLanguages().join(', ')}`
    );
  }

  if (unknownLegacyLanguages.length > 1) {
    throw new Error(
      `Unknown legacy languages: ${unknownLegacyLanguages.join(', ')}. Expected one of ${listLegacyCompatibilityLanguages().join(', ')}`
    );
  }

  const canonicalLegacyLanguages = normalizedLegacyLanguages
    .map(language => LEGACY_LANGUAGE_ALIAS_TO_CANONICAL[language]);
  const baseModuleIds = LEGACY_COMPAT_BASE_MODULE_IDS_BY_TARGET[target || 'claude']
    || LEGACY_COMPAT_BASE_MODULE_IDS_BY_TARGET.claude;
  const moduleIds = dedupeStrings([
    ...baseModuleIds,
    ...(target === 'antigravity'
      ? []

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Pick a supported language from listLegacyCompatibilityLanguages().
  2. Use aliases: 'golang' for go, 'harmonyos' for arkts, 'javascript' (mapped to typescript), 'kotlin' (mapped to java).
  3. Drop the unsupported entry and continue with the rest if the language is non-critical.
  4. Open an issue / add a custom module if you need a language ECC does not ship.

Example fix

// before
resolveLegacyCompatibilitySelection({ legacyLanguages: ['rust', 'scala'] });
// after
const supported = new Set(require('./scripts/lib/install-manifests').listLegacyCompatibilityLanguages());
const legacyLanguages = ['rust', 'scala'].filter(l => supported.has(l.toLowerCase()));
resolveLegacyCompatibilitySelection({ legacyLanguages });
Defensive patterns

Strategy: validation

Validate before calling

const { listLegacyCompatibilityLanguages } = require('./scripts/lib/install-manifests');
const supported = new Set(listLegacyCompatibilityLanguages());
const langs = options.legacyLanguages.filter(l => supported.has(String(l || '').toLowerCase()));
resolveLegacyCompatibilitySelection({ ...options, legacyLanguages: langs });

Prevention

When it happens

Trigger: Passing legacyLanguages: ['rust', 'scala'] — scala is not supported. Also typos like 'javacript', or a language the user assumes is supported (e.g. 'elixir', 'haskell', 'dart') but is not in the map.

Common situations: User requests a language ECC has no rule set for; a wrapper forwards an arbitrary language string from project detection; case errors are NOT the cause because the function lowercases first.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/ad89add030b1b7f0. Report an issue: GitHub.