Skip to content

Commit 540394c

Browse files
committed
fix entry being collecting module
1 parent 7cc9ce0 commit 540394c

File tree

1 file changed

+4
-4
lines changed
  • turbopack/crates/turbopack-core/src/module_graph

1 file changed

+4
-4
lines changed

turbopack/crates/turbopack-core/src/module_graph/collect.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ pub async fn collect_graph(graph: Vc<ModuleGraph>) -> Result<Vc<CollectedModules
130130
node_idx: GraphNodeIndex,
131131
(module_entry_membership, emitted_references)|
132132
-> Result<GraphTraversalAction> {
133+
if let Some(node) = ResolvedVc::try_downcast::<Box<dyn CollectingModule>>(node) {
134+
collecting_modules.insert(node);
135+
}
136+
133137
let Some((parent, ref_data, _)) = parent_info else {
134138
// An entry module
135139
return Ok(GraphTraversalAction::Continue);
@@ -139,10 +143,6 @@ pub async fn collect_graph(graph: Vc<ModuleGraph>) -> Result<Vc<CollectedModules
139143
emitted_references.insert((ref_data, node, node_idx));
140144
}
141145

142-
if let Some(node) = ResolvedVc::try_downcast::<Box<dyn CollectingModule>>(node) {
143-
collecting_modules.insert(node);
144-
}
145-
146146
if parent == node {
147147
// A self-reference
148148
Ok(GraphTraversalAction::Skip)

0 commit comments

Comments
 (0)