{"record":{"id":"9cbe4515a5c0694b","repo":"affaan-m/ECC","slug":"unknown-legacy-languages-unknownlegacylanguages","errorCode":null,"errorMessage":"Unknown legacy languages: ${unknownLegacyLanguages.join(', ')}. Expected one of ${listLegacyCompatibilityLanguages().join(', ')}","messagePattern":"Unknown legacy languages: (.+?)\\. Expected one of (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install-manifests.js","lineNumber":516,"sourceCode":"  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([\n    ...baseModuleIds,\n    ...(target === 'antigravity'\n      ? []\n      : canonicalLegacyLanguages.flatMap(language => LEGACY_LANGUAGE_EXTRA_MODULE_IDS[language] || [])),\n  ]);\n","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install-manifests.js#L498-L534","documentation":"Same validation as the single-unknown-language case, but when two or more unrecognized languages are supplied, the function aggregates them into one error listing all offending values and the accepted set. Fail-fast on the whole batch rather than one at a time.","triggerScenarios":"resolveLegacyCompatibilitySelection({ legacyLanguages: ['pythn', 'rubyy'] }) — two or more strings absent from LEGACY_LANGUAGE_ALIAS_TO_CANONICAL.","commonSituations":"Bulk-pasting a language list from an old config, migrating scripts from a tool with different language names, or scripted generation of flag values.","solutions":["Fix every listed language against the accepted values from listLegacyCompatibilityLanguages()","Diff your language list against LEGACY_LANGUAGE_ALIAS_TO_CANONICAL keys before calling","Log/validate the full list up front so all mistakes are surfaced at once"],"exampleFix":"// before\nresolveLegacyCompatibilitySelection({ legacyLanguages: ['pythn', 'rubyy'] })\n// after\nresolveLegacyCompatibilitySelection({ legacyLanguages: ['python', 'ruby'] })","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 languages: ${bad.join(', ')}`);","typeGuard":"function areKnownLegacyLanguages(list) {\n  return Array.isArray(list) && list.every(l => 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 languages:')) {\n    console.error(`${err.message}`); process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Validate the full language list up front and report all unknowns at once","Diff migrated config lists against the accepted alias keys","Add tests for language-list parsing in your 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"}