Commit f5cb77e7 authored by Luke Sandberg's avatar Luke Sandberg

don't drop issues in the whole_app_module_graph operation

There are some issues that are only discovered during module graph construction (e.g. 'unknown module type') and so dropping them here drops them altogether.
parent 6e9f9b11
...@@ -1527,7 +1527,12 @@ impl Project { ...@@ -1527,7 +1527,12 @@ impl Project {
self: ResolvedVc<Self>, self: ResolvedVc<Self>,
) -> Result<Vc<BaseAndFullModuleGraph>> { ) -> Result<Vc<BaseAndFullModuleGraph>> {
let module_graphs_op = whole_app_module_graph_operation(self); let module_graphs_op = whole_app_module_graph_operation(self);
let module_graphs_vc = if self.next_mode().await?.is_production() { // In development watch mode, keep issues so individual routes can report them.
// In non-watch dev mode (e.g. next build --debug-prerender) or production, drop issues
// so every route doesn't redundantly re-report all shared graph issues.
let module_graphs_vc = if !self.next_mode().await?.is_production()
&& *self.is_watch_enabled().await?
{
module_graphs_op.connect() module_graphs_op.connect()
} else { } else {
let vc = module_graphs_op.resolve().strongly_consistent().await?; let vc = module_graphs_op.resolve().strongly_consistent().await?;
......
...@@ -2214,15 +2214,6 @@ impl NextConfig { ...@@ -2214,15 +2214,6 @@ impl NextConfig {
})) }))
} }
#[turbo_tasks::function]
pub async fn client_source_maps(&self, mode: Vc<NextMode>) -> Result<Vc<bool>> {
let source_maps = self.experimental.turbopack_source_maps;
Ok(Vc::cell(source_maps.unwrap_or(match &*mode.await? {
NextMode::Development => true,
NextMode::Build => self.production_browser_source_maps,
})))
}
#[turbo_tasks::function] #[turbo_tasks::function]
pub fn lightningcss_feature_flags( pub fn lightningcss_feature_flags(
&self, &self,
......
...@@ -62,10 +62,10 @@ impl Issue for ModuleIssue { ...@@ -62,10 +62,10 @@ impl Issue for ModuleIssue {
pub async fn emit_unknown_module_type_error(source: Vc<Box<dyn Source>>) -> Result<()> { pub async fn emit_unknown_module_type_error(source: Vc<Box<dyn Source>>) -> Result<()> {
ModuleIssue {ident: source.ident().to_resolved().await?, ModuleIssue {ident: source.ident().to_resolved().await?,
title: StyledString::Text(rcstr!("Unknown module type")).resolved_cell(), title: StyledString::Text(rcstr!("Unknown module type")).resolved_cell(),
description: StyledString::Text( description: StyledString::Text(rcstr!(
r"This module doesn't have an associated type. Use a known file extension, or register a loader for it. r"This module doesn't have an associated type. Use a known file extension, or register a loader for it.
Read more: https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders".into(), Read more: https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders"),
) )
.resolved_cell(), .resolved_cell(),
source: Some(IssueSource::from_source_only(source.to_resolved().await?)),} source: Some(IssueSource::from_source_only(source.to_resolved().await?)),}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment