Skip to content

Commit

Permalink
Turbopack HMR: Avoid infinite loops caused by cycles between modules …
Browse files Browse the repository at this point in the history
…in the dependency chain. (vercel/turborepo#8210)

Previously, if a change were made in a module that participated in a
dependency cycle, gathering affected modules would loop infinitely. This
check prevents this.

Test Plan: Fixes #65537
  • Loading branch information
wbinnssmith authored May 28, 2024
1 parent e36e3bd commit 6fa3af6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,11 @@ function getAffectedModuleEffects(moduleId: ModuleId): ModuleEffect {
const { moduleId, dependencyChain } = nextItem;

if (moduleId != null) {
if (outdatedModules.has(moduleId)) {
// Avoid infinite loops caused by cycles between modules in the dependency chain.
continue;
}

outdatedModules.add(moduleId);
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6fa3af6

Please sign in to comment.