{"record":{"id":"9857392e78327f5d","repo":"affaan-m/ECC","slug":"no-legacy-languages-were-provided","errorCode":null,"errorMessage":"No legacy languages were provided","messagePattern":"No legacy languages were provided","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/install-manifests.js","lineNumber":483,"sourceCode":"    .map(exclusion => ({ ...exclusion }));\n}\n\nfunction resolveLegacyCompatibilitySelection(options = {}) {\n  const manifests = loadInstallManifests(options);\n  const target = options.target || null;\n\n  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","sourceCodeStart":465,"sourceCodeEnd":501,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/lib/install-manifests.js#L465-L501","documentation":"Thrown by resolveLegacyCompatibilitySelection() when dedupeStrings(options.legacyLanguages) — after lowercasing — yields an empty array. The legacy path requires at least one language because its whole purpose is to install language-specific rule modules. Calling it without languages is a no-op the library refuses to silently perform.","triggerScenarios":"Calling resolveLegacyCompatibilitySelection({}) with no legacyLanguages, or with legacyLanguages: [], or with values that dedupe down to nothing (e.g. [null, undefined]).","commonSituations":"A CLI defaulted legacyLanguages to an empty array when no --lang flag was passed; a wrapper script conditionally builds the list and the branch produced nothing; the caller confused resolveLegacyCompatibilitySelection with resolveInstallPlan.","solutions":["Pass at least one language, e.g. legacyLanguages: ['rust'] or ['typescript', 'python'].","If you do not want legacy language modules, call resolveInstallPlan() instead.","Guard the call: if (langs.length === 0) return resolveInstallPlan(opts).","Use listLegacyCompatibilityLanguages() to surface valid values to the end user."],"exampleFix":"// before\nresolveLegacyCompatibilitySelection({ target: 'claude', legacyLanguages: langs });\n// after\nif (!Array.isArray(langs) || langs.length === 0) {\n  return resolveInstallPlan({ target: 'claude' });\n}\nresolveLegacyCompatibilitySelection({ target: 'claude', legacyLanguages: langs });","handlingStrategy":"validation","validationCode":"const langs = dedupe((options.legacyLanguages || []).map(l => String(l || '').toLowerCase()));\nif (langs.length === 0) {\n  // legacy mode is opt-in — fall back to plain plan\n  return resolveInstallPlan({ target: options.target });\n}\nresolveLegacyCompatibilitySelection({ ...options, legacyLanguages: langs });","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only call resolveLegacyCompatibilitySelection when you actually have language input.","Gate the legacy path behind an explicit CLI flag so empty lists never reach it."],"tags":["install","validation","legacy","argument"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}