affaan-m/ECC · error
No legacy languages were provided
Error message
No legacy languages were provided
What it means
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.
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
Example fix
// before
resolveLegacyCompatibilitySelection({ target: 'claude-code', legacyLanguages: [] })
// after
resolveLegacyCompatibilitySelection({ target: 'claude-code', legacyLanguages: ['python'] }) Defensive patterns
Strategy: validation
Validate before calling
const langs = (options.legacyLanguages ?? []).map(s => String(s).trim()).filter(Boolean);
if (langs.length === 0) {
throw new Error('at least one legacy language is required');
} Type guard
function hasLegacyLanguages(v) {
return Array.isArray(v) && v.some(x => typeof x === 'string' && x.trim() !== '');
} Try / catch
try {
const sel = resolveLegacyCompatibilitySelection(options);
} catch (err) {
if (err.message === 'No legacy languages were provided') {
console.error('Usage: --legacy-language <name> (at least one)'); process.exitCode = 2;
} else throw err;
} Prevention
- 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
When it happens
Trigger: Calling resolveLegacyCompatibilitySelection() with no legacyLanguages, an empty array [], an array of only empty/whitespace strings that dedupeStrings strips, or legacyLanguages: undefined.
Common situations: 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.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- At least one guided harness must be selected
- No install profile, module IDs, included components, or…
- No install profile, module IDs, or included component IDs…
- all overlays must be readable local files
- all takes must be readable local files
AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16).
Data as JSON: /api/errors/9857392e78327f5d.
Report an issue: GitHub.
Appendix: source
Thrown at scripts/lib/install-manifests.js:503
.map(exclusion => ({ ...exclusion }));
}
function resolveLegacyCompatibilitySelection(options = {}) {
const manifests = loadInstallManifests(options);
const target = options.target || null;
if (target && !SUPPORTED_INSTALL_TARGETS.includes(target)) {
throw new Error(
`Unknown install target: ${target}. Expected one of ${SUPPORTED_INSTALL_TARGETS.join(', ')}`
);
}
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 = normalizedLegacyLanguagesView on GitHub (pinned to 8321021c54)