{"record":{"id":"f2c918f6095bb17b","repo":"eyaltoledano/claude-task-master","slug":"warning-invaliddependencies-length-invalid-dep","errorCode":null,"errorMessage":"Warning: ${invalidDependencies.length} invalid dependency reference(s) found${tagContext}:","messagePattern":"Warning: (.+?) invalid dependency reference\\(s\\) found(.+?):","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/cli/src/commands/list.command.ts","lineNumber":495,"sourceCode":"\t\t\tallTags: true\n\t\t};\n\t}\n\n\t/**\n\t * Display warnings for invalid dependency references\n\t * @param invalidDependencies - Array of invalid dependency references from buildBlocksMap\n\t * @param tagName - Optional tag name for context in multi-tag mode\n\t */\n\tprivate displayInvalidDependencyWarnings(\n\t\tinvalidDependencies: InvalidDependency[],\n\t\ttagName?: string\n\t): void {\n\t\tif (invalidDependencies.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst tagContext = tagName ? ` (tag: ${tagName})` : '';\n\t\tconsole.warn(\n\t\t\tchalk.yellow(\n\t\t\t\t`\\nWarning: ${invalidDependencies.length} invalid dependency reference(s) found${tagContext}:`\n\t\t\t)\n\t\t);\n\t\tinvalidDependencies.slice(0, 5).forEach(({ taskId, depId }) => {\n\t\t\tconsole.warn(\n\t\t\t\tchalk.gray(`  Task ${taskId} depends on non-existent task ${depId}`)\n\t\t\t);\n\t\t});\n\t\tif (invalidDependencies.length > 5) {\n\t\t\tconsole.warn(\n\t\t\t\tchalk.gray(`  ...and ${invalidDependencies.length - 5} more`)\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Display results based on format","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/apps/cli/src/commands/list.command.ts#L477-L513","documentation":"displayInvalidDependencyWarnings in list.command.ts warns when tasks reference dependencies that don't exist. The header line reports the count of invalid references and, optionally, the tag being examined. It is a data-integrity warning emitted during task listing, not a thrown exception.","triggerScenarios":"Calling getTasks or getTasksFromAllTags when the fetched task set is passed through dependency validation and one or more tasks list a dependency ID absent from the task collection.","commonSituations":"Manually edited tasks.json removing a task but leaving dangling references; task IDs reused/renamed across tags; merge conflicts partially resolved; imports from other projects with mismatched IDs.","solutions":["Fix or remove the dangling dependency entries in the affected tasks (edit tasks.json or use dependency remove).","Recreate the missing task if it should exist, restoring the referenced ID.","Run a dependency-validation/repair command to prune invalid references in bulk.","Check the per-task detail lines following this warning to see exactly which pairs are broken."],"exampleFix":"// before (tasks.json)\n\"dependencies\": [3, 99]\n// after — remove reference to non-existent task 99\n\"dependencies\": [3]","handlingStrategy":"validation","validationCode":"function findDanglingDeps(tasks) {\n  const ids = new Set(tasks.map(t => String(t.id)));\n  return tasks.flatMap(t =>\n    (t.dependencies || [])\n      .map(String)\n      .filter(d => !ids.has(d))\n      .map(d => ({ taskId: t.id, depId: d }))\n  );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hand-edit tasks.json without re-validating dependencies.","When deleting tasks, use the tooling so dependent references are cleaned.","Run a dependency-validation pass after merges or imports."],"tags":["data-integrity","dependencies","warning","cli"],"backgroundTag":"dangling-reference","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}