Turbopack: shorter error message for ModuleBatchesGraph::get_entry_index#92828
Conversation
Failing test suitesCommit: 2009f96 | About building and testing Next.js
Expand output● missing-suspense-with-csr-bailout › useSearchParams › should pass build if useSearchParams is wrapped in a suspense boundary
Expand output● app dir - metadata dynamic routes suspense › should render metadata in head when root layout is wrapped with Suspense for bot requests |
Merging this PR will not alter performance
Comparing Footnotes
|
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
Failing test suitesCommit: 2009f96 | About building and testing Next.js
Expand output● missing-suspense-with-csr-bailout › useSearchParams › should pass build if useSearchParams is wrapped in a suspense boundary
Expand output● app dir - metadata dynamic routes suspense › should render metadata in head when root layout is wrapped with Suspense for bot requests |
…dex (#92828) ### What? In `ModuleBatchesGraph::get_entry_index`, when an entry module is not found in the graph, the error message included the full list of all possible entries (with their resolved string identifiers). This is an expensive operation that requires async resolution of every entry's `ident().to_string()`. ### Why? In production builds, this verbose error output is unnecessary overhead and produces very long error messages that are hard to read. The list of possible entries is only useful during development/debugging. ### How? Gate the expensive "possible entries" diagnostic behind `cfg!(debug_assertions)`. In release builds, a short `bail!("Entry is not in graph")` is used instead. In debug builds, the full diagnostic with all possible entry identifiers is still shown to aid debugging. This mirrors the same approach already applied to `ChunkGroupInfo::get_index_of`. <!-- NEXT_JS_LLM_PR -->
What?
In
ModuleBatchesGraph::get_entry_index, when an entry module is not found in the graph, the error message included the full list of all possible entries (with their resolved string identifiers). This is an expensive operation that requires async resolution of every entry'sident().to_string().Why?
In production builds, this verbose error output is unnecessary overhead and produces very long error messages that are hard to read. The list of possible entries is only useful during development/debugging.
How?
Gate the expensive "possible entries" diagnostic behind
cfg!(debug_assertions). In release builds, a shortbail!("Entry is not in graph")is used instead. In debug builds, the full diagnostic with all possible entry identifiers is still shown to aid debugging.This mirrors the same approach already applied to
ChunkGroupInfo::get_index_of.