{"record":{"id":"a20de917db74a108","repo":"affaan-m/ECC","slug":"unknown-component-family-family-expected-one","errorCode":null,"errorMessage":"Unknown component family: ${family}. Expected one of ${Object.keys(COMPONENT_FAMILY_PREFIXES).join(', ')}","messagePattern":"Unknown component family: (.+?)\\. Expected one of (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install-manifests.js","lineNumber":387,"sourceCode":"\nfunction listLegacyCompatibilityLanguages() {\n  return Object.keys(LEGACY_LANGUAGE_ALIAS_TO_CANONICAL).sort();\n}\n\nfunction validateInstallModuleIds(moduleIds, options = {}) {\n  const manifests = loadInstallManifests(options);\n  const normalizedModuleIds = dedupeStrings(moduleIds);\n  assertKnownModuleIds(normalizedModuleIds, manifests);\n  return normalizedModuleIds;\n}\n\nfunction listInstallComponents(options = {}) {\n  const manifests = loadInstallManifests(options);\n  const family = options.family || null;\n  const target = options.target || null;\n\n  if (family && !Object.hasOwn(COMPONENT_FAMILY_PREFIXES, family)) {\n    throw new Error(\n      `Unknown component family: ${family}. Expected one of ${Object.keys(COMPONENT_FAMILY_PREFIXES).join(', ')}`\n    );\n  }\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  return manifests.components\n    .filter(component => !family || component.family === family)\n    .map(component => {\n      const moduleIds = dedupeStrings(component.modules);\n      const modules = moduleIds\n        .map(moduleId => manifests.modulesById.get(moduleId))\n        .filter(Boolean);\n      const targets = intersectTargets(modules);","sourceCodeStart":369,"sourceCodeEnd":405,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install-manifests.js#L369-L405","documentation":"listInstallComponents() validates the optional options.family against the known keys of COMPONENT_FAMILY_PREFIXES before filtering components. If the family string does not match any registered family, the library refuses to run rather than silently returning an empty list.","triggerScenarios":"Calling listInstallComponents({ family: 'xyz' }) with a family name that is not a key of COMPONENT_FAMILY_PREFIXES — typos, renamed families after a version bump, or programmatic input from user config/CLI args.","commonSituations":"Typing 'skill' instead of 'skills', copying an option from outdated docs, wiring a CLI flag through without normalizing case, or a renamed/removed family in a newer ECC version.","solutions":["Check the allowed family names with Object.keys(require('./scripts/lib/install-manifests').COMPONENT_FAMILY_PREFIXES) or the error message itself and use one exactly","Fix the typo / casing in the family value (families are lowercase, plural)","Call listInstallComponents() without the family option to list everything, then derive valid families from the returned components","If family comes from user input, validate it against COMPONENT_FAMILY_PREFIXES before calling"],"exampleFix":"// before\nlistInstallComponents({ family: 'skill' });\n// after\nlistInstallComponents({ family: 'skills' });","handlingStrategy":"validation","validationCode":"const { COMPONENT_FAMILY_PREFIXES } = require('./scripts/lib/install-manifests');\nif (family != null && !Object.hasOwn(COMPONENT_FAMILY_PREFIXES, family)) {\n  throw new Error(`Invalid family '${family}'. Valid: ${Object.keys(COMPONENT_FAMILY_PREFIXES).join(', ')}`);\n}","typeGuard":"const isValidFamily = (f) => typeof f === 'string' && Object.hasOwn(COMPONENT_FAMILY_PREFIXES, f);","tryCatchPattern":"try {\n  const comps = listInstallComponents({ family });\n} catch (err) {\n  if (err.message.startsWith('Unknown component family')) {\n    console.error(err.message);\n    process.exitCode = 1;\n  } else throw err;\n}","preventionTips":["Derive family options from Object.keys(COMPONENT_FAMILY_PREFIXES) instead of hardcoding strings","Trim and lowercase user input before passing it as family","Re-check valid families after each ECC upgrade","Don't copy family names from other tools' docs"],"tags":["validation","invalid-argument","install-manifests"],"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"}