From 42d2f755ccdf7dc48a47fc42cf8395c8445f3500 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Thu, 28 Nov 2024 13:38:28 +0100 Subject: [PATCH] Try to prevent duplicate issues --- crates/next-api/src/module_graph.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/next-api/src/module_graph.rs b/crates/next-api/src/module_graph.rs index c4ddc44274e0f..de59891a67448 100644 --- a/crates/next-api/src/module_graph.rs +++ b/crates/next-api/src/module_graph.rs @@ -10,9 +10,12 @@ use petgraph::{ visit::Dfs, }; use tracing::Instrument; -use turbo_tasks::{FxIndexMap, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, Vc}; +use turbo_tasks::{ + CollectiblesSource, FxIndexMap, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, Vc, +}; use turbopack_core::{ context::AssetContext, + issue::Issue, module::{Module, Modules}, reference::primary_referenced_modules, }; @@ -318,9 +321,10 @@ pub async fn get_reduced_graphs_for_endpoint( false, vec![ async move { - SingleModuleGraph::new_with_entries(project.get_all_entries()) - .to_resolved() - .await + let vc = SingleModuleGraph::new_with_entries(project.get_all_entries()); + let vc = vc.resolve_strongly_consistent().await?; + let _ = vc.take_collectibles::>(); + vc.to_resolved().await } .instrument(tracing::info_span!("module graph for app")) .await?,