Skip to content

Commit 13e2e91

Browse files
committed
fix entry being collecting module
1 parent 7bc8217 commit 13e2e91

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
@@ -145,6 +145,10 @@ pub async fn collect_graph(graph: Vc<ModuleGraph>) -> Result<Vc<CollectedModules
145145
node_idx: GraphNodeIndex,
146146
(module_entry_membership, emitted_references)|
147147
-> Result<GraphTraversalAction> {
148+
if let Some(node) = ResolvedVc::try_downcast::<Box<dyn CollectingModule>>(node) {
149+
collecting_modules.insert(node);
150+
}
151+
148152
let Some((parent, ref_data, _)) = parent_info else {
149153
// An entry module
150154
return Ok(GraphTraversalAction::Continue);
@@ -154,10 +158,6 @@ pub async fn collect_graph(graph: Vc<ModuleGraph>) -> Result<Vc<CollectedModules
154158
emitted_references.insert((ref_data, node, node_idx));
155159
}
156160

157-
if let Some(node) = ResolvedVc::try_downcast::<Box<dyn CollectingModule>>(node) {
158-
collecting_modules.insert(node);
159-
}
160-
161161
if parent == node {
162162
// A self-reference
163163
Ok(GraphTraversalAction::Skip)

0 commit comments

Comments
 (0)