{"record":{"id":"baee7174a27469cb","repo":"affaan-m/ECC","slug":"install-module-moduleid-has-unsupported-targets","errorCode":null,"errorMessage":"Install module ${moduleId} has unsupported targets: ${unsupportedTargets.join(', ')}","messagePattern":"Install module (.+?) has unsupported targets: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install-manifests.js","lineNumber":264,"sourceCode":"function readModuleTargetsOrThrow(module) {\n  const moduleId = module && module.id ? module.id : '<unknown>';\n  const targets = module && module.targets;\n\n  if (!Array.isArray(targets)) {\n    throw new Error(`Install module ${moduleId} has invalid targets; expected an array of supported target ids`);\n  }\n\n  const normalizedTargets = targets.map(target => (\n    typeof target === 'string' ? target.trim() : ''\n  ));\n\n  if (normalizedTargets.some(target => target.length === 0)) {\n    throw new Error(`Install module ${moduleId} has invalid targets; expected an array of supported target ids`);\n  }\n\n  const unsupportedTargets = normalizedTargets.filter(target => !SUPPORTED_INSTALL_TARGETS.includes(target));\n  if (unsupportedTargets.length > 0) {\n    throw new Error(\n      `Install module ${moduleId} has unsupported targets: ${unsupportedTargets.join(', ')}`\n    );\n  }\n\n  return normalizedTargets;\n}\n\nfunction assertKnownModuleIds(moduleIds, manifests) {\n  const unknownModuleIds = dedupeStrings(moduleIds)\n    .filter(moduleId => !manifests.modulesById.has(moduleId));\n\n  if (unknownModuleIds.length === 1) {\n    throw new Error(`Unknown install module: ${unknownModuleIds[0]}`);\n  }\n\n  if (unknownModuleIds.length > 1) {\n    throw new Error(`Unknown install modules: ${unknownModuleIds.join(', ')}`);\n  }","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install-manifests.js#L246-L282","documentation":"Thrown by readModuleTargetsOrThrow when a module's targets array contains entries that are valid non-empty strings but are not in SUPPORTED_INSTALL_TARGETS. The loader lists the offending target ids in the message so the manifest author can correct them. It runs only after the emptiness check passes.","triggerScenarios":"loadInstallManifests() or supportsTarget() reading install-modules.json where a module declares targets with ids not present in SUPPORTED_INSTALL_TARGETS, e.g. \"targets\": [\"claudecode\"] instead of \"claude-code\", or \"vscode\" when unsupported.","commonSituations":"Typo in a target id after renaming targets; a new target added to a module before it was registered in SUPPORTED_INSTALL_TARGETS; following outdated docs that reference removed target names; adding a module copied from a fork with different target vocabulary.","solutions":["Read the listed unsupported target ids from the error message and locate the module in manifests/install-modules.json.","Replace each unsupported id with the correct value from SUPPORTED_INSTALL_TARGETS (check scripts/lib/install-manifests.js for the current list).","If the target should legitimately exist, add it to SUPPORTED_INSTALL_TARGETS in scripts/lib/install-manifests.js and update install logic/tests.","Regenerate the catalog (npm run catalog:sync) if module/target wiring changed.","Re-run loadInstallManifests to verify."],"exampleFix":"// before (install-modules.json)\n\"targets\": [\"claudecode\", \"cursor\"]\n\n// after\n\"targets\": [\"claude-code\", \"cursor\"]","handlingStrategy":"validation","validationCode":"const { SUPPORTED_INSTALL_TARGETS } = require('./scripts/lib/install-manifests');\nconst bad = moduleConfig.targets.filter(t => !SUPPORTED_INSTALL_TARGETS.includes(t.trim()));\nif (bad.length) throw new Error(`Unsupported targets: ${bad.join(', ')}`);","typeGuard":"function usesOnlySupportedTargets(targets, supported) {\n  return Array.isArray(targets) &&\n    targets.every(t => typeof t === 'string' && supported.includes(t.trim()));\n}","tryCatchPattern":null,"preventionTips":["Copy target ids from SUPPORTED_INSTALL_TARGETS rather than typing them from memory.","When adding a new target, update SUPPORTED_INSTALL_TARGETS and manifests together in one commit.","Grep install-modules.json for the exact supported ids after renames.","Keep a schema enum of supported targets so editors flag invalid values."],"tags":["config","validation","install-manifests","enum"],"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"}