{"record":{"id":"ad89add030b1b7f0","repo":"affaan-m/ECC","slug":"unknown-legacy-language-unknownlegacylanguages","errorCode":null,"errorMessage":"Unknown legacy language: ${unknownLegacyLanguages[0]}. Expected one of ${listLegacyCompatibilityLanguages().join(', ')}","messagePattern":"Unknown legacy language: (.+?)\\. Expected one of (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install-manifests.js","lineNumber":510,"sourceCode":"  if (target && !SUPPORTED_INSTALL_TARGETS.includes(target)) {\n    throw new Error(\n      `Unknown install target: ${target}. Expected one of ${SUPPORTED_INSTALL_TARGETS.join(', ')}`\n    );\n  }\n\n  const legacyLanguages = dedupeStrings(options.legacyLanguages)\n    .map(language => language.toLowerCase());\n  const normalizedLegacyLanguages = dedupeStrings(legacyLanguages);\n\n  if (normalizedLegacyLanguages.length === 0) {\n    throw new Error('No legacy languages were provided');\n  }\n\n  const unknownLegacyLanguages = normalizedLegacyLanguages\n    .filter(language => !Object.hasOwn(LEGACY_LANGUAGE_ALIAS_TO_CANONICAL, language));\n\n  if (unknownLegacyLanguages.length === 1) {\n    throw new Error(\n      `Unknown legacy language: ${unknownLegacyLanguages[0]}. Expected one of ${listLegacyCompatibilityLanguages().join(', ')}`\n    );\n  }\n\n  if (unknownLegacyLanguages.length > 1) {\n    throw new Error(\n      `Unknown legacy languages: ${unknownLegacyLanguages.join(', ')}. Expected one of ${listLegacyCompatibilityLanguages().join(', ')}`\n    );\n  }\n\n  const canonicalLegacyLanguages = normalizedLegacyLanguages\n    .map(language => LEGACY_LANGUAGE_ALIAS_TO_CANONICAL[language]);\n  const ruleLanguages = normalizedLegacyLanguages.map(language => (\n    LEGACY_LANGUAGE_RULE_NAMESPACES[language] || language\n  ));\n  const baseModuleIds = LEGACY_COMPAT_BASE_MODULE_IDS_BY_TARGET[target || 'claude']\n    || LEGACY_COMPAT_BASE_MODULE_IDS_BY_TARGET.claude;\n  const moduleIds = dedupeStrings([","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install-manifests.js#L492-L528","documentation":"Each normalized legacy language must be a key of LEGACY_LANGUAGE_ALIAS_TO_CANONICAL. When exactly one unknown language remains after filtering, the function throws naming it and listing the accepted values from listLegacyCompatibilityLanguages().","triggerScenarios":"resolveLegacyCompatibilitySelection({ legacyLanguages: ['pythn'] }) — a single unrecognized language string (note: it is lowercased before the check, so case alone will not trigger it).","commonSituations":"Typos in language names, using full names like 'typescript' when only aliases are supported, or passing values from another tool's vocabulary.","solutions":["Use one of the accepted values/aliases listed in the error message","Check LEGACY_LANGUAGE_ALIAS_TO_CANONICAL in install-manifests.js for the exact alias set","Normalize user input against the alias map before calling"],"exampleFix":"// before\nresolveLegacyCompatibilitySelection({ legacyLanguages: ['pythn'] })\n// after\nresolveLegacyCompatibilitySelection({ legacyLanguages: ['python'] })","handlingStrategy":"validation","validationCode":"const accepted = new Set(Object.keys(LEGACY_LANGUAGE_ALIAS_TO_CANONICAL));\nconst bad = options.legacyLanguages.filter(l => !accepted.has(String(l).toLowerCase()));\nif (bad.length === 1) throw new Error(`unknown legacy language: ${bad[0]}`);","typeGuard":"function isKnownLegacyLanguage(l) {\n  return typeof l === 'string' && Object.hasOwn(LEGACY_LANGUAGE_ALIAS_TO_CANONICAL, l.toLowerCase());\n}","tryCatchPattern":"try {\n  const sel = resolveLegacyCompatibilitySelection(options);\n} catch (err) {\n  if (err.message.startsWith('Unknown legacy language:')) {\n    console.error(`${err.message}`); process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Offer autocomplete/choices from listLegacyCompatibilityLanguages() in your CLI","Lowercase and trim language inputs before passing them","Keep an alias map of common spellings in your own tooling"],"tags":["validation","cli","alias"],"backgroundTag":"invalid-enum-value","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}