Skip to content

Turbopack: shorter error message for ModuleBatchesGraph::get_entry_index#92828

Merged
sokra merged 1 commit into
canaryfrom
sokra/shorter-message
Apr 15, 2026
Merged

Turbopack: shorter error message for ModuleBatchesGraph::get_entry_index#92828
sokra merged 1 commit into
canaryfrom
sokra/shorter-message

Conversation

@sokra
Copy link
Copy Markdown
Member

@sokra sokra commented Apr 15, 2026

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.

@nextjs-bot nextjs-bot added created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js. labels Apr 15, 2026
@mischnic mischnic marked this pull request as ready for review April 15, 2026 14:44
@nextjs-bot
Copy link
Copy Markdown
Contributor

nextjs-bot commented Apr 15, 2026

Failing test suites

Commit: 2009f96 | About building and testing Next.js

pnpm test-start test/e2e/app-dir/missing-suspense-with-csr-bailout/missing-suspense-with-csr-bailout.test.ts (job)

  • missing-suspense-with-csr-bailout > useSearchParams > should pass build if useSearchParams is wrapped in a suspense boundary (DD)
Expand output

● missing-suspense-with-csr-bailout › useSearchParams › should pass build if useSearchParams is wrapped in a suspense boundary

expect(received).resolves.toEqual(expected) // deep equality

- Expected  - 1
+ Received  + 1

  Object {
    "cliOutput": StringNotContaining "useSearchParams() should be wrapped in a suspense boundary at page \"/\".",
-   "exitCode": 0,
+   "exitCode": 1,
  }

  45 |       await next.renameFile('app/layout-suspense.js', 'app/layout.js')
  46 |
> 47 |       await expect(next.build()).resolves.toEqual({
     |                                           ^
  48 |         exitCode: 0,
  49 |         cliOutput: expect.not.stringContaining(message),
  50 |       })

  at Object.toEqual (../node_modules/.pnpm/expect@29.7.0/node_modules/expect/build/index.js:174:22)
  at Object.toEqual (e2e/app-dir/missing-suspense-with-csr-bailout/missing-suspense-with-csr-bailout.test.ts:47:43)

pnpm test-start test/e2e/app-dir/metadata-suspense/index.test.ts (job)

  • app dir - metadata dynamic routes suspense > should render metadata in head when root layout is wrapped with Suspense for bot requests (DD)
Expand output

● app dir - metadata dynamic routes suspense › should render metadata in head when root layout is wrapped with Suspense for bot requests

next build failed with code/signal 1

   97 |             if (code || signal)
   98 |               reject(
>  99 |                 new Error(
      |                 ^
  100 |                   `next build failed with code/signal ${code || signal}`
  101 |                 )
  102 |               )

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:17)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 15, 2026

Merging this PR will not alter performance

✅ 17 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing sokra/shorter-message (2009f96) with canary (74629e8)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@nextjs-bot
Copy link
Copy Markdown
Contributor

Stats from current PR

✅ No significant changes detected

📊 All Metrics
📖 Metrics Glossary

Dev Server Metrics:

  • Listen = TCP port starts accepting connections
  • First Request = HTTP server returns successful response
  • Cold = Fresh build (no cache)
  • Warm = With cached build artifacts

Build Metrics:

  • Fresh = Clean build (no .next directory)
  • Cached = With existing .next directory

Change Thresholds:

  • Time: Changes < 50ms AND < 10%, OR < 2% are insignificant
  • Size: Changes < 1KB AND < 1% are insignificant
  • All other changes are flagged to catch regressions

⚡ Dev Server

Metric Canary PR Change Trend
Cold (Listen) 455ms 456ms ▁██▁█
Cold (Ready in log) 442ms 442ms ▃▃▄▃▅
Cold (First Request) 839ms 832ms ▇█▁█▁
Warm (Listen) 455ms 455ms ██▅█▅
Warm (Ready in log) 441ms 442ms ▆▆▃▃▃
Warm (First Request) 344ms 344ms ▄▃▃▄▁
📦 Dev Server (Webpack) (Legacy)

📦 Dev Server (Webpack)

Metric Canary PR Change Trend
Cold (Listen) 456ms 456ms ▁▁▁▅▁
Cold (Ready in log) 442ms 442ms ▃▁▂▁▃
Cold (First Request) 1.979s 1.953s ▄▁▃▁▄
Warm (Listen) 456ms 456ms ▅▅▁▅█
Warm (Ready in log) 441ms 441ms ▂▁▂▁▃
Warm (First Request) 1.982s 1.961s ▅▁▄▁▄

⚡ Production Builds

Metric Canary PR Change Trend
Fresh Build 4.050s 3.995s ▃▂▃▁▅
Cached Build 4.031s 4.026s ▂▁▃▃▅
📦 Production Builds (Webpack) (Legacy)

📦 Production Builds (Webpack)

Metric Canary PR Change Trend
Fresh Build 14.602s 14.682s ▄▁▁▁▃
Cached Build 14.792s 14.797s ▃▁▁▁▃
node_modules Size 493 MB 493 MB ▁██▁█
📦 Bundle Sizes

Bundle Sizes

⚡ Turbopack

Client

Main Bundles
Canary PR Change
053b9v5j96uu_.js gzip 8.56 kB N/A -
07rxhp_1_g4mu.js gzip 13.1 kB N/A -
096aa2uod0_wa.js gzip 9.82 kB N/A -
0cz1d0mv5g_q7.js gzip 39.4 kB 39.4 kB
0ea8vo2o6kp_s.js gzip 13.3 kB N/A -
0egovw6-5i1e3.js gzip 8.57 kB N/A -
0fli3_wppnim5.js gzip 12.9 kB N/A -
0gkovryjv05n3.js gzip 154 B N/A -
0ho78l23ixdy7.js gzip 155 B N/A -
0jrg8yoqn4b8e.js gzip 155 B N/A -
0k09jwjeb-tki.js gzip 13.8 kB N/A -
0kb7_ep3r1z0_.js gzip 10.1 kB N/A -
0kmgih16pb2zy.js gzip 9.24 kB N/A -
0lbv96yr1uj-x.js gzip 168 B N/A -
0wxpyd8r-vipl.js gzip 1.47 kB N/A -
1-z_xm7pzpbeh.js gzip 49.2 kB N/A -
11qa6mv6j4f0n.js gzip 160 B N/A -
16lhqjoqbznyg.js gzip 220 B 220 B
16vepdkipri3r.js gzip 8.51 kB N/A -
17n96uu6y1pxq.js gzip 8.6 kB N/A -
1d9ms1y2nit5w.js gzip 65.5 kB N/A -
1elt1qium-r2m.css gzip 115 B 115 B
1odlz7_bqi4gv.js gzip 160 B N/A -
1s-lssnhdqk31.js gzip 156 B N/A -
1xz7fhgdco-x_.js gzip 8.59 kB N/A -
2__-e_ym8n788.js gzip 450 B N/A -
22o6xd9_ywdu6.js gzip 233 B N/A -
2avcdi72oetam.js gzip 156 B N/A -
2h9_xc-4i5_oy.js gzip 152 B N/A -
2k1q_gre6hp0-.js gzip 8.56 kB N/A -
2kvj8yrfznmwx.js gzip 5.69 kB N/A -
2sgqisp4604si.js gzip 8.51 kB N/A -
2u7io78pjtekk.js gzip 156 B N/A -
3_lh2q04233ur.js gzip 70.8 kB N/A -
342ijzvrpe53h.js gzip 2.29 kB N/A -
3p575fh88tejl.js gzip 155 B N/A -
3v9s-fz24f8oo.js gzip 10.4 kB N/A -
3zdh_rd16s0i8.js gzip 157 B N/A -
420pn_b9x-3ir.js gzip 8.62 kB N/A -
43l229j-6khv5.js gzip 156 B N/A -
44un3--wmqiyh.js gzip 7.61 kB N/A -
turbopack-0x..2c1o.js gzip 4.19 kB N/A -
turbopack-0y..rjc9.js gzip 4.2 kB N/A -
turbopack-1k..rbj5.js gzip 4.19 kB N/A -
turbopack-1q.._m7g.js gzip 4.19 kB N/A -
turbopack-2-..4mlc.js gzip 4.17 kB N/A -
turbopack-22..h7oj.js gzip 4.19 kB N/A -
turbopack-25..lf2b.js gzip 4.19 kB N/A -
turbopack-2b..nby5.js gzip 4.19 kB N/A -
turbopack-2m..wm_6.js gzip 4.19 kB N/A -
turbopack-2n.._pfr.js gzip 4.19 kB N/A -
turbopack-3b..ydgx.js gzip 4.19 kB N/A -
turbopack-3e..0ajm.js gzip 4.19 kB N/A -
turbopack-3l..dvr5.js gzip 4.19 kB N/A -
turbopack-3m..qy5_.js gzip 4.19 kB N/A -
03_szppy5nakp.js gzip N/A 49.2 kB -
0arkbdqpxc37i.js gzip N/A 8.6 kB -
0iuamvde1mkye.js gzip N/A 166 B -
0mz-rbiau93_g.js gzip N/A 161 B -
0tvekitj587fh.js gzip N/A 8.51 kB -
0vcsfpshdbpoi.js gzip N/A 157 B -
0z83a1om5rvtt.js gzip N/A 7.61 kB -
1-jqyfc89tixo.js gzip N/A 1.46 kB -
14t1kneseb8th.js gzip N/A 2.3 kB -
16bh0aqv641xv.js gzip N/A 157 B -
192q2suy7rwb_.js gzip N/A 8.56 kB -
1ab2xruymo-oj.js gzip N/A 449 B -
1im7xphq6dxob.js gzip N/A 159 B -
1ng_99sotnhzq.js gzip N/A 159 B -
1qui_nsqw5190.js gzip N/A 157 B -
1wzrm0xjjbzn5.js gzip N/A 10.1 kB -
25a1yz7zua29z.js gzip N/A 13.8 kB -
2f2bp_kexa37v.js gzip N/A 13.3 kB -
2fpb7l1pbce6e.js gzip N/A 65.5 kB -
2i5v1taq97gql.js gzip N/A 8.59 kB -
2jrvadyrjp0yr.js gzip N/A 155 B -
2n3vh0w0tnb_2.js gzip N/A 8.52 kB -
2u_rpxq3tzytl.js gzip N/A 233 B -
2wfbykz1avdns.js gzip N/A 8.56 kB -
32sifemopndov.js gzip N/A 10.4 kB -
368lim5wq0o0r.js gzip N/A 12.9 kB -
37ba9t8u6k_9f.js gzip N/A 156 B -
3aouhp_o4j3ta.js gzip N/A 151 B -
3de283pazbu99.js gzip N/A 9.81 kB -
3drqjohogojbw.js gzip N/A 5.69 kB -
3g8l1m2-o-ewi.js gzip N/A 13.1 kB -
3gp2o_v7jcw6s.js gzip N/A 8.57 kB -
3kab57ds4zwc9.js gzip N/A 157 B -
3qu7g1q2l_x2n.js gzip N/A 9.24 kB -
3vucw_kkxf-6j.js gzip N/A 155 B -
3zycucbo0ee-y.js gzip N/A 70.8 kB -
41p1znhcs5rk8.js gzip N/A 155 B -
43j6fjudq0a3_.js gzip N/A 8.62 kB -
turbopack-02..ejcf.js gzip N/A 4.19 kB -
turbopack-04..36zk.js gzip N/A 4.19 kB -
turbopack-05..ed1i.js gzip N/A 4.19 kB -
turbopack-08..ymqg.js gzip N/A 4.19 kB -
turbopack-1e..75yv.js gzip N/A 4.17 kB -
turbopack-1e..lwrg.js gzip N/A 4.19 kB -
turbopack-1s..5095.js gzip N/A 4.19 kB -
turbopack-1w..leed.js gzip N/A 4.19 kB -
turbopack-1x..h7hw.js gzip N/A 4.19 kB -
turbopack-29..nv35.js gzip N/A 4.19 kB -
turbopack-2d..42om.js gzip N/A 4.2 kB -
turbopack-3f..ewzo.js gzip N/A 4.19 kB -
turbopack-3m..3yye.js gzip N/A 4.19 kB -
turbopack-3z..lv_i.js gzip N/A 4.19 kB -
Total 465 kB 465 kB ⚠️ +39 B

Server

Middleware
Canary PR Change
middleware-b..fest.js gzip 715 B 718 B
Total 715 B 718 B ⚠️ +3 B
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 434 B 429 B 🟢 5 B (-1%)
Total 434 B 429 B ✅ -5 B

📦 Webpack

Client

Main Bundles
Canary PR Change
2637-HASH.js gzip 4.63 kB N/A -
7724.HASH.js gzip 169 B N/A -
8274-HASH.js gzip 61.3 kB N/A -
8817-HASH.js gzip 5.59 kB N/A -
c3500254-HASH.js gzip 62.8 kB N/A -
framework-HASH.js gzip 59.7 kB 59.7 kB
main-app-HASH.js gzip 254 B 255 B
main-HASH.js gzip 39.4 kB 39.4 kB
webpack-HASH.js gzip 1.68 kB 1.68 kB
5887-HASH.js gzip N/A 5.61 kB -
6522-HASH.js gzip N/A 60.7 kB -
6779-HASH.js gzip N/A 4.63 kB -
8854.HASH.js gzip N/A 169 B -
eab920f9-HASH.js gzip N/A 62.8 kB -
Total 235 kB 235 kB ✅ -619 B
Polyfills
Canary PR Change
polyfills-HASH.js gzip 39.4 kB 39.4 kB
Total 39.4 kB 39.4 kB
Pages
Canary PR Change
_app-HASH.js gzip 193 B 193 B
_error-HASH.js gzip 182 B 182 B
css-HASH.js gzip 333 B 334 B
dynamic-HASH.js gzip 1.81 kB 1.8 kB
edge-ssr-HASH.js gzip 255 B 255 B
head-HASH.js gzip 353 B 349 B 🟢 4 B (-1%)
hooks-HASH.js gzip 384 B 382 B
image-HASH.js gzip 581 B 581 B
index-HASH.js gzip 260 B 259 B
link-HASH.js gzip 2.51 kB 2.51 kB
routerDirect..HASH.js gzip 316 B 318 B
script-HASH.js gzip 386 B 386 B
withRouter-HASH.js gzip 313 B 314 B
1afbb74e6ecf..834.css gzip 106 B 106 B
Total 7.98 kB 7.97 kB ✅ -10 B

Server

Edge SSR
Canary PR Change
edge-ssr.js gzip 126 kB 126 kB
page.js gzip 273 kB 273 kB
Total 399 kB 399 kB ✅ -450 B
Middleware
Canary PR Change
middleware-b..fest.js gzip 618 B 617 B
middleware-r..fest.js gzip 156 B 156 B
middleware.js gzip 44 kB 44.3 kB
edge-runtime..pack.js gzip 842 B 842 B
Total 45.6 kB 45.9 kB ⚠️ +309 B
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 721 B 720 B
Total 721 B 720 B ✅ -1 B
Build Cache
Canary PR Change
0.pack gzip 4.38 MB 4.38 MB
index.pack gzip 113 kB 114 kB 🔴 +1.18 kB (+1%)
index.pack.old gzip 114 kB 113 kB
Total 4.61 MB 4.6 MB ✅ -998 B

🔄 Shared (bundler-independent)

Runtimes
Canary PR Change
app-page-exp...dev.js gzip 346 kB 346 kB
app-page-exp..prod.js gzip 192 kB 192 kB
app-page-tur...dev.js gzip 346 kB 346 kB
app-page-tur..prod.js gzip 192 kB 192 kB
app-page-tur...dev.js gzip 343 kB 343 kB
app-page-tur..prod.js gzip 190 kB 190 kB
app-page.run...dev.js gzip 343 kB 343 kB
app-page.run..prod.js gzip 190 kB 190 kB
app-route-ex...dev.js gzip 77 kB 77 kB
app-route-ex..prod.js gzip 52.5 kB 52.5 kB
app-route-tu...dev.js gzip 77.1 kB 77.1 kB
app-route-tu..prod.js gzip 52.6 kB 52.6 kB
app-route-tu...dev.js gzip 76.7 kB 76.7 kB
app-route-tu..prod.js gzip 52.3 kB 52.3 kB
app-route.ru...dev.js gzip 76.6 kB 76.6 kB
app-route.ru..prod.js gzip 52.3 kB 52.3 kB
dist_client_...dev.js gzip 324 B 324 B
dist_client_...dev.js gzip 326 B 326 B
dist_client_...dev.js gzip 318 B 318 B
dist_client_...dev.js gzip 317 B 317 B
pages-api-tu...dev.js gzip 43.9 kB 43.9 kB
pages-api-tu..prod.js gzip 33.5 kB 33.5 kB
pages-api.ru...dev.js gzip 43.9 kB 43.9 kB
pages-api.ru..prod.js gzip 33.5 kB 33.5 kB
pages-turbo....dev.js gzip 53.3 kB 53.3 kB
pages-turbo...prod.js gzip 39.1 kB 39.1 kB
pages.runtim...dev.js gzip 53.3 kB 53.3 kB
pages.runtim..prod.js gzip 39.1 kB 39.1 kB
server.runti..prod.js gzip 62.9 kB 62.9 kB
Total 3.06 MB 3.06 MB ⚠️ +1 B
📎 Tarball URL
https://vercel-packages.vercel.app/next/commits/18426cbdb6e489ece1b78aba07bc4dde96178564/next

@nextjs-bot
Copy link
Copy Markdown
Contributor

nextjs-bot commented Apr 15, 2026

Failing test suites

Commit: 2009f96 | About building and testing Next.js

pnpm test-start test/e2e/app-dir/missing-suspense-with-csr-bailout/missing-suspense-with-csr-bailout.test.ts (job)

  • missing-suspense-with-csr-bailout > useSearchParams > should pass build if useSearchParams is wrapped in a suspense boundary (DD)
Expand output

● missing-suspense-with-csr-bailout › useSearchParams › should pass build if useSearchParams is wrapped in a suspense boundary

expect(received).resolves.toEqual(expected) // deep equality

- Expected  - 1
+ Received  + 1

  Object {
    "cliOutput": StringNotContaining "useSearchParams() should be wrapped in a suspense boundary at page \"/\".",
-   "exitCode": 0,
+   "exitCode": 1,
  }

  45 |       await next.renameFile('app/layout-suspense.js', 'app/layout.js')
  46 |
> 47 |       await expect(next.build()).resolves.toEqual({
     |                                           ^
  48 |         exitCode: 0,
  49 |         cliOutput: expect.not.stringContaining(message),
  50 |       })

  at Object.toEqual (../node_modules/.pnpm/expect@29.7.0/node_modules/expect/build/index.js:174:22)
  at Object.toEqual (e2e/app-dir/missing-suspense-with-csr-bailout/missing-suspense-with-csr-bailout.test.ts:47:43)

pnpm test-start test/e2e/app-dir/metadata-suspense/index.test.ts (job)

  • app dir - metadata dynamic routes suspense > should render metadata in head when root layout is wrapped with Suspense for bot requests (DD)
Expand output

● app dir - metadata dynamic routes suspense › should render metadata in head when root layout is wrapped with Suspense for bot requests

next build failed with code/signal 1

   97 |             if (code || signal)
   98 |               reject(
>  99 |                 new Error(
      |                 ^
  100 |                   `next build failed with code/signal ${code || signal}`
  101 |                 )
  102 |               )

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:17)

@sokra sokra merged commit f8de120 into canary Apr 15, 2026
493 of 503 checks passed
@sokra sokra deleted the sokra/shorter-message branch April 15, 2026 15:19
sokra added a commit that referenced this pull request Apr 15, 2026
…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 -->
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

created-by: Turbopack team PRs by the Turbopack team. locked Turbopack Related to Turbopack with Next.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants