From 8cde6c27087f401d085fe267091ae75334309d96 Mon Sep 17 00:00:00 2001 From: Ralph Khreish <35776126+Crunchyman-ralph@users.noreply.github.com> Date: Mon, 16 Jun 2025 10:32:34 +0200 Subject: [PATCH] fix(contextGatherer): cannot read properties of undefined reading forEach (#789) --- .changeset/rotten-months-brake.md | 5 +++++ scripts/modules/utils/contextGatherer.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/rotten-months-brake.md diff --git a/.changeset/rotten-months-brake.md b/.changeset/rotten-months-brake.md new file mode 100644 index 00000000..6d72979b --- /dev/null +++ b/.changeset/rotten-months-brake.md @@ -0,0 +1,5 @@ +--- +"task-master-ai": patch +--- + +Fix contextGatherer bug when adding a task `Cannot read properties of undefined (reading 'forEach')` diff --git a/scripts/modules/utils/contextGatherer.js b/scripts/modules/utils/contextGatherer.js index 29721858..1a826dec 100644 --- a/scripts/modules/utils/contextGatherer.js +++ b/scripts/modules/utils/contextGatherer.js @@ -123,7 +123,7 @@ export class ContextGatherer { // Dependency Graph Analysis if (dependencyTasks.length > 0) { - const dependencyResults = this._buildDependencyContext(dependencyTasks); + const dependencyResults = this._buildDependencyGraphs(dependencyTasks); dependencyResults.allRelatedTaskIds.forEach((id) => finalTaskIds.add(String(id)) );