| |
| |
| |
| |
| @@ -1995,11 +1995,21 @@ impl AppEndpoint { |
| ) |
| .await?; |
| |
| + // The server actions loader is a separate graph entry that is not reachable from |
| + // rsc_entry, but it is chunked into the endpoint output, so its modules (e.g. externals |
| + // imported by actions) must be traced as well. |
| + let mut entry_modules = vec![rsc_entry]; |
| + entry_modules.extend( |
| + self.additional_entries(*module_graphs.base) |
| + .await? |
| + .all_modules(), |
| + ); |
| + |
| Ok(trace_endpoint( |
| this.app_project.project(), |
| Some(app_function_name(&app_entry.original_name).into()), |
| *module_graphs.full, |
| - *rsc_entry, |
| + Vc::cell(entry_modules), |
| )) |
| } |
| } |
| |
| |
| |
| |
| @@ -200,12 +200,12 @@ impl InstrumentationEndpoint { |
| #[turbo_tasks::function] |
| async fn trace_result(self: Vc<Self>) -> Result<Vc<EndpointTraceResult>> { |
| let this = self.await?; |
| - let userland_module = self.entry_module(); |
| + let userland_module = self.entry_module().to_resolved().await?; |
| Ok(trace_endpoint( |
| *this.project, |
| None, |
| - this.project.module_graph(userland_module), |
| - userland_module, |
| + this.project.module_graph(*userland_module), |
| + Vc::cell(vec![userland_module]), |
| )) |
| } |
| } |
| |
| |
| |
| |
| @@ -342,12 +342,12 @@ impl MiddlewareEndpoint { |
| #[turbo_tasks::function] |
| async fn trace_result(self: Vc<Self>) -> Result<Vc<EndpointTraceResult>> { |
| let this = self.await?; |
| - let userland_module = self.entry_module(); |
| + let userland_module = self.entry_module().to_resolved().await?; |
| Ok(trace_endpoint( |
| *this.project, |
| None, |
| - this.project.module_graph(userland_module), |
| - userland_module, |
| + this.project.module_graph(*userland_module), |
| + Vc::cell(vec![userland_module]), |
| )) |
| } |
| } |
| |
| |
| |
| |
| @@ -61,7 +61,7 @@ pub async fn trace_endpoint( |
| project: ResolvedVc<Project>, |
| page_name: Option<RcStr>, |
| module_graph: ResolvedVc<ModuleGraph>, |
| - entry_module: ResolvedVc<Box<dyn Module>>, |
| + entry_modules: Vc<Modules>, |
| ) -> Result<Vc<EndpointTraceResult>> { |
| let span = tracing::info_span!("trace endpoint", path = debug(&page_name)); |
| async { |
| @@ -78,7 +78,7 @@ pub async fn trace_endpoint( |
| // Collect referenced assets and externals from module graph |
| let all_modules = traced_modules_for_entries( |
| *module_graph, |
| - Vc::cell(vec![entry_module]), |
| + entry_modules, |
| traced_entries, |
| tracing_exclude_glob(page_name.clone(), project_path.clone(), next_config) |
| .await? |
| |
| |
| |
| |
| @@ -1591,7 +1591,7 @@ impl PageEndpoint { |
| this.pages_project.project(), |
| Some(pages_function_name(&this.original_name).into()), |
| ssr_module_graph, |
| - *ssr_module, |
| + Vc::cell(vec![ssr_module]), |
| )) |
| } |
| } |
|
|