Files
vercel__next.js/turbopack
Tobias Koppers 8a540b58b6 Turbopack: shorter error message for ModuleBatchesGraph::get_entry_index (#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 -->
2026-04-15 17:21:41 +02:00
..