{"record":{"id":"aba84c8d75c14508","repo":"eyaltoledano/claude-task-master","slug":"task-taskid-depends-on-non-existent-task-de","errorCode":null,"errorMessage":"  Task ${taskId} depends on non-existent task ${depId}","messagePattern":"  Task (.+?) depends on non-existent task (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/cli/src/commands/list.command.ts","lineNumber":501,"sourceCode":"\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\n\t */\n\tprivate displayResults(\n\t\tresult: ListTasksResult,\n\t\toptions: ListCommandOptions\n\t): void {\n\t\t// Resolve format: --json and --compact flags override --format option","sourceCodeStart":483,"sourceCodeEnd":519,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/apps/cli/src/commands/list.command.ts#L483-L519","documentation":"Per-item detail line from displayInvalidDependencyWarnings: after the aggregate warning, each of the first 5 invalid pairs is printed as 'Task <taskId> depends on non-existent task <depId>'. It identifies exactly which task/dependency pair is broken.","triggerScenarios":"Same as the aggregate warning (705): getTasks/getTasksFromAllTags finds a task whose dependencies array contains an ID not present in the loaded task set; this line prints for each such pair (up to 5).","commonSituations":"Deleted tasks still referenced by survivors; typos in hand-edited dependency IDs; cross-tag references that don't resolve in the current tag.","solutions":["Edit the offending task to remove the non-existent dependency ID.","Recreate the missing task with the referenced ID if it is needed.","Run a repair/validation pass to clean all dangling dependencies at once."],"exampleFix":"// before\n{\"id\": 2, \"dependencies\": [1, 7]}\n// after — task 7 does not exist\n{\"id\": 2, \"dependencies\": [1]}","handlingStrategy":"validation","validationCode":"const ids = new Set(tasks.map(t => String(t.id)));\nfor (const t of tasks) {\n  for (const d of t.dependencies || []) {\n    if (!ids.has(String(d))) {\n      t.dependencies = t.dependencies.filter(x => String(x) !== String(d)); // prune\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prune dangling dependency IDs programmatically after any bulk deletion.","Keep dependency IDs numeric and consistent (string/number mismatches).","Audit per-task detail lines after every listing that emits this warning."],"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"}