{"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":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install-manifests.js","lineNumber":503,"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":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install-manifests.js#L485-L521","documentation":"After normalizing and deduplicating options.legacyLanguages, resolveLegacyCompatibilitySelection requires at least one legacy language. If the resulting list is empty the function throws, because a compatibility selection without languages has nothing to resolve. It is a required-argument guard.","triggerScenarios":"Calling resolveLegacyCompatibilitySelection() with no legacyLanguages, an empty array [], an array of only empty/whitespace strings that dedupeStrings strips, or legacyLanguages: undefined.","commonSituations":"Forgetting to pass --legacy-language style CLI flags, parsing flags with a splitter that yields empty strings, or wiring code that forwards an empty config array.","solutions":["Pass at least one valid legacy language, e.g. legacyLanguages: ['python']","Check upstream flag parsing so empty strings are filtered or defaulted","Throw/validate a clear error in your own CLI when no language flags are supplied"],"exampleFix":"// before\nresolveLegacyCompatibilitySelection({ target: 'claude-code', legacyLanguages: [] })\n// after\nresolveLegacyCompatibilitySelection({ target: 'claude-code', legacyLanguages: ['python'] })","handlingStrategy":"validation","validationCode":"const langs = (options.legacyLanguages ?? []).map(s => String(s).trim()).filter(Boolean);\nif (langs.length === 0) {\n  throw new Error('at least one legacy language is required');\n}","typeGuard":"function hasLegacyLanguages(v) {\n  return Array.isArray(v) && v.some(x => typeof x === 'string' && x.trim() !== '');\n}","tryCatchPattern":"try {\n  const sel = resolveLegacyCompatibilitySelection(options);\n} catch (err) {\n  if (err.message === 'No legacy languages were provided') {\n    console.error('Usage: --legacy-language <name> (at least one)'); process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Require the --legacy-language flag in your CLI parser (minItems >= 1)","Filter out empty strings before forwarding flag arrays","Default to a sensible language when the user omits the flag"],"tags":["validation","cli","empty-input"],"backgroundTag":"empty-required-field","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"}