affaan-m/ECC · error · Error

Unknown legacy languages: ${unknownLegacyLanguages.join(', '

Error message

Unknown legacy languages: ${unknownLegacyLanguages.join(', ')}. Expected one of ${listLegacyCompatibilityLanguages().join(', ')}

What it means

Same check as error 185 but for the multi-unknown case. When unknownLegacyLanguages.length > 1 the library switches to a comma-joined message so the caller sees every bad value at once instead of fixing them one at a time.

Source

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

  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'
      ? []
      : canonicalLegacyLanguages.flatMap(language => LEGACY_LANGUAGE_EXTRA_MODULE_IDS[language] || [])),
  ]);

  assertKnownModuleIds(moduleIds, manifests);

  return {

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Filter the list against listLegacyCompatibilityLanguages() before calling.
  2. Use the alias map for variants (e.g. 'ts' is NOT an alias — use 'typescript').
  3. Keep only the languages you actually want rules for; do not forward every detected language.
  4. If the entire list is unsupported, fall back to resolveInstallPlan() with no legacy languages.

Example fix

// before
resolveLegacyCompatibilitySelection({ legacyLanguages: detected });
// after
const supported = new Set(require('./scripts/lib/install-manifests').listLegacyCompatibilityLanguages());
const legacyLanguages = detected.filter(l => supported.has(String(l || '').toLowerCase()));
if (legacyLanguages.length === 0) return resolveInstallPlan({ target });
resolveLegacyCompatibilitySelection({ target, legacyLanguages });
Defensive patterns

Strategy: validation

Validate before calling

const { listLegacyCompatibilityLanguages } = require('./scripts/lib/install-manifests');
const supported = new Set(listLegacyCompatibilityLanguages());
const clean = options.legacyLanguages
  .map(l => String(l || '').toLowerCase())
  .filter(l => supported.has(l));
if (clean.length === 0) return resolveInstallPlan({ target: options.target });
resolveLegacyCompatibilitySelection({ ...options, legacyLanguages: clean });

Prevention

When it happens

Trigger: Passing legacyLanguages: ['scala', 'haskell', 'elixir'] — none of these are keys in LEGACY_LANGUAGE_ALIAS_TO_CANONICAL.

Common situations: Project detector returns a list of languages from package.json / Cargo.toml / mix.exs and forwards all of them; a polyglot repo includes languages ECC has no rules for; bulk migration script.

Related errors


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