Skip to content

Redesign blocking route dev overlay and build errors#92638

Merged
aurorascharff merged 55 commits intocanaryfrom
aurorascharff/instant-error-overhaul
Apr 17, 2026
Merged

Redesign blocking route dev overlay and build errors#92638
aurorascharff merged 55 commits intocanaryfrom
aurorascharff/instant-error-overhaul

Conversation

@aurorascharff
Copy link
Copy Markdown
Member

@aurorascharff aurorascharff commented Apr 10, 2026

What?

Redesigns the blocking-route error overlay for instant navigation errors with a distinct "Instant" overlay path, visual technique cards, and updated error wording framed around navigation impact.

Why?

The current overlay dumps every possible cause and fix in one block of text. The new design is friendlier — amber "Instant" badge, a short headline framed around navigation, and responsive code snippet cards showing each fix pattern.

Demo

How?

Overlay

  • New early-return path in errors.tsx for blocking-route errors without refinement — renders InstantRuntimeError with CodeFrame → description → technique cards → CallStack → ErrorCause
  • InstantGuidance component with responsive CSS grid of fix technique cards (3 per variant)
  • Color-coded cards with colored borders and matching highlight text (blue, purple, red)
  • "Make route params static" card (runtime only) has a dashed border indicating it's conditional

Build & CLI messages

  • Build output messages extracted into blocking-route-messages.ts and deduplicated across dynamic-rendering.ts
  • dynamicOrRuntimeBodyMessage added for build-time static validation where the specific cause can't be pinpointed — lists all APIs (fetch(...), cookies(), headers(), params, searchParams, connection())
  • isRuntimeVariant() replaces the old includes('cookies()') heuristic which broke because both templates mention cookies()
  • logBuildDebugHint() extracted and shared between logDisallowedDynamicError and instant validation — adds "run next dev" and "next build --debug-prerender" hints to instant validation build output

Results:
Google Chrome 2026-04-17 16 37 00
Google Chrome 2026-04-17 16 36 37

@nextjs-bot
Copy link
Copy Markdown
Collaborator

nextjs-bot commented Apr 10, 2026

Tests Passed

@nextjs-bot
Copy link
Copy Markdown
Collaborator

nextjs-bot commented Apr 10, 2026

Stats from current PR

🔴 1 regression

Metric Canary PR Change Trend
node_modules Size 494 MB 494 MB 🔴 +73.2 kB (+0%) ▁█▁▁█
📊 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) 456ms 455ms ▁▁▁▁▁
Cold (Ready in log) 440ms 440ms ▁▂▁▂▂
Cold (First Request) 828ms 824ms ▁▁▁█▁
Warm (Listen) 455ms 456ms ▁▁▁▁▁
Warm (Ready in log) 439ms 440ms ▁▁▁▂▁
Warm (First Request) 338ms 336ms ▂▆▃▅▄
📦 Dev Server (Webpack) (Legacy)

📦 Dev Server (Webpack)

Metric Canary PR Change Trend
Cold (Listen) 455ms 456ms ▁▅▁▅█
Cold (Ready in log) 437ms 437ms ▁▂▃▃▄
Cold (First Request) 1.947s 1.936s ▁▅▁▅▆
Warm (Listen) 456ms 454ms ▅▅▅▁▅
Warm (Ready in log) 438ms 436ms ▁▁▂▃▄
Warm (First Request) 1.955s 1.958s ▁▄▂▄▄

⚡ Production Builds

Metric Canary PR Change Trend
Fresh Build 3.986s 3.957s ▃▃▁▃▃
Cached Build 4.030s 4.018s ▂▃▁▁▂
📦 Production Builds (Webpack) (Legacy)

📦 Production Builds (Webpack)

Metric Canary PR Change Trend
Fresh Build 14.420s 14.421s ▁▁▃▃▃
Cached Build 14.544s 14.580s ▁▁▂▃▃
node_modules Size 494 MB 494 MB 🔴 +73.2 kB (+0%) ▁█▁▁█
📦 Bundle Sizes

Bundle Sizes

⚡ Turbopack

Client

Main Bundles
Canary PR Change
04gfaeiu1v7qm.js gzip 151 B N/A -
07rxhp_1_g4mu.js gzip 13.1 kB N/A -
07vz_1vlust95.js gzip 65.5 kB N/A -
08avva-dy02e7.js gzip 10.4 kB N/A -
09x_ycos2214h.js gzip 151 B N/A -
0cz1d0mv5g_q7.js gzip 39.4 kB 39.4 kB
0fli3_wppnim5.js gzip 12.9 kB N/A -
0k09jwjeb-tki.js gzip 13.8 kB N/A -
0kb7_ep3r1z0_.js gzip 10.1 kB N/A -
0kw8xgqdrilf6.js gzip 8.56 kB N/A -
0ojkk2e654xsc.js gzip 8.59 kB N/A -
0wfoal20dkqj1.js gzip 155 B N/A -
0wxpyd8r-vipl.js gzip 1.47 kB N/A -
0xy2fhla48_rd.js gzip 9.24 kB N/A -
0zx3fp91iid52.js gzip 159 B N/A -
10wqsvi2mgfmi.js gzip 9.82 kB 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 -
18y4_8-9or0mn.js gzip 8.51 kB N/A -
19410kg_2bl_2.js gzip 156 B N/A -
1elt1qium-r2m.css gzip 115 B 115 B
1gq145j3kps-h.js gzip 8.62 kB N/A -
1li2wvnrlll1x.js gzip 155 B N/A -
1nsh-mbn0e-se.js gzip 8.56 kB N/A -
1tsrrp1tdngti.js gzip 13.3 kB N/A -
2__-e_ym8n788.js gzip 450 B N/A -
22o6xd9_ywdu6.js gzip 233 B N/A -
2587zu9zz3ch0.js gzip 154 B N/A -
25ykkt57gkfew.js gzip 154 B N/A -
26ui6d5bv607a.js gzip 49.3 kB N/A -
2kb7581t3yg4r.js gzip 153 B N/A -
2kvj8yrfznmwx.js gzip 5.69 kB N/A -
2qv7m7xjnokgr.js gzip 8.58 kB N/A -
342ijzvrpe53h.js gzip 2.29 kB N/A -
37pyv-119nldk.js gzip 152 B N/A -
3geqw_3h7k33y.js gzip 156 B N/A -
3ok6wj7wwsorf.js gzip 70.8 kB N/A -
3sfdvnlx2-d2i.js gzip 152 B N/A -
3u-chifslwdvs.js gzip 166 B N/A -
44un3--wmqiyh.js gzip 7.61 kB N/A -
turbopack-09..02ja.js gzip 4.2 kB N/A -
turbopack-0c.._q68.js gzip 4.18 kB N/A -
turbopack-0s..yucr.js gzip 4.19 kB N/A -
turbopack-0x..vpta.js gzip 4.19 kB N/A -
turbopack-10..-d_w.js gzip 4.19 kB N/A -
turbopack-11..dlm2.js gzip 4.18 kB N/A -
turbopack-1k..j62f.js gzip 4.19 kB N/A -
turbopack-2e..0_2s.js gzip 4.17 kB N/A -
turbopack-2u..oxs7.js gzip 4.18 kB N/A -
turbopack-37..th14.js gzip 4.18 kB N/A -
turbopack-39..mfcn.js gzip 4.18 kB N/A -
turbopack-3h..4bnr.js gzip 4.18 kB N/A -
turbopack-3i..gib8.js gzip 4.19 kB N/A -
turbopack-3m..bo_z.js gzip 4.19 kB N/A -
07ao55cvtbxdj.js gzip N/A 153 B -
09t9i6o8nvir7.js gzip N/A 49.6 kB -
0arkbdqpxc37i.js gzip N/A 8.6 kB -
0bz-xifewa17d.js gzip N/A 8.63 kB -
0tp80kb9upsmd.js gzip N/A 153 B -
0tsy2vtfmen7f.js gzip N/A 155 B -
0tv67up09u6yz.js gzip N/A 168 B -
0tvekitj587fh.js gzip N/A 8.51 kB -
0y-5s9e_qen41.js gzip N/A 160 B -
0yvk6-wi8e9wh.js gzip N/A 13.3 kB -
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 -
15sb1-dsqfk_j.js gzip N/A 8.59 kB -
1ab2xruymo-oj.js gzip N/A 449 B -
1gt0tm9ba-fkj.js gzip N/A 70.8 kB -
1p-256e9l_n93.js gzip N/A 156 B -
1rexplishteym.js gzip N/A 156 B -
1tu25qtsmfhar.js gzip N/A 9.82 kB -
1vein_gnv3mwr.js gzip N/A 8.56 kB -
1wtjzfc14dkv9.js gzip N/A 154 B -
1wzrm0xjjbzn5.js gzip N/A 10.1 kB -
1xvan__507d2k.js gzip N/A 155 B -
1z3g0uaqtv9_3.js gzip N/A 8.56 kB -
25a1yz7zua29z.js gzip N/A 13.8 kB -
2bi5hx402juv-.js gzip N/A 8.58 kB -
2hy56297fog9u.js gzip N/A 8.52 kB -
2u_rpxq3tzytl.js gzip N/A 233 B -
31pzx_2wlpu4e.js gzip N/A 156 B -
368lim5wq0o0r.js gzip N/A 12.9 kB -
3drqjohogojbw.js gzip N/A 5.69 kB -
3fs484yi1tj7v.js gzip N/A 156 B -
3g8l1m2-o-ewi.js gzip N/A 13.1 kB -
3jmkxsnxg0nrh.js gzip N/A 10.4 kB -
3qacr5lkwv7qz.js gzip N/A 65.5 kB -
3qi06md02f2cn.js gzip N/A 159 B -
3socpyg9nr02a.js gzip N/A 157 B -
3wpp8nvyoj121.js gzip N/A 9.24 kB -
turbopack-0n..mrvy.js gzip N/A 4.17 kB -
turbopack-0p..kynv.js gzip N/A 4.19 kB -
turbopack-0s..7ud3.js gzip N/A 4.18 kB -
turbopack-17..4gpi.js gzip N/A 4.19 kB -
turbopack-1c..9gyb.js gzip N/A 4.19 kB -
turbopack-1e..ccp_.js gzip N/A 4.19 kB -
turbopack-1s..h27x.js gzip N/A 4.19 kB -
turbopack-1t..njk8.js gzip N/A 4.2 kB -
turbopack-29..e4gm.js gzip N/A 4.19 kB -
turbopack-2a..5zpv.js gzip N/A 4.19 kB -
turbopack-2c..tpfn.js gzip N/A 4.19 kB -
turbopack-2k..hjo6.js gzip N/A 4.19 kB -
turbopack-32..3ekq.js gzip N/A 4.19 kB -
turbopack-42..fj8z.js gzip N/A 4.19 kB -
Total 465 kB 465 kB ⚠️ +397 B

Server

Middleware
Canary PR Change
middleware-b..fest.js gzip 713 B 715 B
Total 713 B 715 B ⚠️ +2 B
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 431 B 433 B
Total 431 B 433 B ⚠️ +2 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.4 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.3 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.8 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 236 kB 235 kB ✅ -640 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 ⚠️ +18 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 43.9 kB 44.4 kB 🔴 +538 B (+1%)
edge-runtime..pack.js gzip 842 B 842 B
Total 45.5 kB 46.1 kB ⚠️ +537 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 113 kB
index.pack.old gzip 113 kB 115 kB 🔴 +2.21 kB (+2%)
Total 4.61 MB 4.61 MB ⚠️ +3.01 kB

🔄 Shared (bundler-independent)

Runtimes
Canary PR Change
app-page-exp...dev.js gzip 347 kB 347 kB
app-page-exp..prod.js gzip 192 kB 192 kB
app-page-tur...dev.js gzip 346 kB 347 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 344 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 63 kB 63 kB
Total 3.06 MB 3.07 MB ⚠️ +3.08 kB
📝 Changed Files (9 files)

Files with changes:

  • app-page-exp..ntime.dev.js
  • app-page-exp..time.prod.js
  • app-page-tur..ntime.dev.js
  • app-page-tur..time.prod.js
  • app-page-tur..ntime.dev.js
  • app-page-tur..time.prod.js
  • app-page.runtime.dev.js
  • app-page.runtime.prod.js
  • server.runtime.prod.js
View diffs
app-page-exp..ntime.dev.js
failed to diff
app-page-exp..time.prod.js
failed to diff
app-page-tur..ntime.dev.js
failed to diff
app-page-tur..time.prod.js
failed to diff
app-page-tur..ntime.dev.js
failed to diff
app-page-tur..time.prod.js
failed to diff
app-page.runtime.dev.js
failed to diff
app-page.runtime.prod.js
failed to diff
server.runtime.prod.js

Diff too large to display

📎 Tarball URL
https://vercel-packages.vercel.app/next/commits/b922df65ac55f50dfae0b1b423ffdd04631ca6b8/next

Comment thread packages/next/src/server/app-render/blocking-route-messages.ts Outdated
Comment thread packages/next/src/next-devtools/dev-overlay/container/errors.tsx Outdated
@aurorascharff aurorascharff changed the title Overhaul blocking-route dev overlay for clarity and actionability Redesign blocking-route error messages, overlay, and docs Apr 11, 2026
@aurorascharff aurorascharff changed the title Redesign blocking-route error messages, overlay, and docs Redesign blocking-route error messages and dev overlay Apr 11, 2026
@aurorascharff aurorascharff force-pushed the aurorascharff/instant-error-overhaul branch from 9b5f875 to 834deb8 Compare April 12, 2026 21:21
- Centralize console error strings in blocking-route-messages.ts
- Add interactive decision-tree guidance with collapsible sections
- Use native HTML <details>/<summary> for accessible collapsibles
- Extract error detection logic into blocking-route-error-details.ts
- Extract old-style description components into blocking-route-descriptions.tsx
- Add per-fix documentation links to nextjs.org/docs/messages
- Extract specific API names (e.g. cookies()) from error messages
The dynamicBodyMessage now contains "request-time API" and the
dynamic metadata/viewport messages contain "cookies()", which
caused the fallback string heuristic to classify them as runtime
variant instead of navigation variant.

Fix by matching "A request-time API" only when not preceded by
"Either" (which is unique to the dynamic template), and removing
the cookies() check entirely.

Made-with: Cursor
…ails

Same misclassification bug as blocking-route-error-details.ts:
dynamicMetadataMessage contains "cookies()" as an example, causing
the heuristic to incorrectly classify it as runtime variant.

Made-with: Cursor
… logic

- Remove dead `generateMetadata` branch from `BlockingPageLoadErrorDescription`
  (never reached; metadata errors route through `DynamicMetadataErrorDescription`)
- Remove unused `apiName` field (regex never matched, always null)
- Colocate `getDynamicMetadataErrorDetails` into `blocking-route-error-details.ts`
- Make `isRuntimeVariant` private (single source, no longer exported)
- Fix grammar: "This indicate" → "This indicates"
- Tighten `refinement` type to `'' | 'generateViewport'`

Made-with: Cursor
With partial fallbacks (default in 16.3), generateStaticParams alone
doesn't resolve the blocking-route error. You always need <Suspense>
or loading.js. GSP prerender known values at build time as an
optimization on top of that.

Made-with: Cursor
…ixes with inline diffs, structured build messages

- Add "What happened" / "Expected" explanation section between headline and stack trace
- Restructure guidance: each fix is a collapsible with an inline code diff and docs link
- First (most common) fix opens by default
- All fix links point to blocking-route error page sections
- Update build output messages with structured Cause/Triggers/Fix format

Made-with: Cursor
@aurorascharff aurorascharff force-pushed the aurorascharff/instant-error-overhaul branch from 834deb8 to d2038f7 Compare April 13, 2026 12:33
Build can't reliably distinguish Runtime from Dynamic causes, so
merge runtimeBodyMessage/dynamicBodyMessage into a single bodyMessage
(same for metadata and viewport). Reframe the fix list with
"the right fix depends on which API triggered this and what behavior
you want" instead of duplicating the next dev hint the framework
already provides below.

Revert all test snapshot changes to match canary — snapshots will be
updated in a follow-up once messages are finalized.

Made-with: Cursor
…ssification

Revert the merged bodyMessage/metadataMessage/viewportMessage back to
separate runtimeBodyMessage/dynamicBodyMessage etc. so the dev overlay
can distinguish runtime APIs from uncached data.

Restore the original isRuntimeVariant detection that matches on
'request-time API', 'cookies()', and 'Runtime data' — the tightened
check broke classification when the second validation pass overrides
with DynamicHoleKind.Dynamic.

Also stamp syncDynamicErrorWithStack errors with runtimeBodyMessage
since sync dynamic errors are always from runtime APIs.

Made-with: Cursor
@aurorascharff aurorascharff force-pushed the aurorascharff/instant-error-overhaul branch from 72976a4 to eba3d2b Compare April 14, 2026 08:40
Comment thread packages/next/src/server/app-render/blocking-route-messages.ts Outdated
…untimeShell/StaticShell messages

- isRuntimeVariant now checks for capital 'A request-time API' to only
  match runtimeBodyMessage, preventing fetch() from being misclassified
  as runtime variant
- Swap RuntimeShell/StaticShell body/metadata/viewport message functions
  to match the pre-merge assignment

Made-with: Cursor
… build messages

- Replace tree diagram cards with compact code snippet cards (Vercel-themed, light/dark mode)
- Update card names to match meeting decisions: Cache dynamic data, Add a new Suspense boundary, Lower access into a Suspense boundary, Let it block
- Update build messages to include example APIs (cookies(), headers(), fetch(), etc.)
- Fix isRuntimeVariant detection for new message format
- Remove unused collapsible component, blocking-route-guidance, fix-diagrams, maybeGuidance variable
- Clean up dead instantDevOverlay feature flag

Made-with: Cursor
@aurorascharff aurorascharff changed the title Redesign blocking-route error messages and dev overlay Redesign blocking-route dev overlay with Instant technique cards Apr 15, 2026
… messages

- Cards: merged Suspense cards into "Move within Suspense", GSP runtime-only
  with dashed conditional border, responsive grid (minmax 250px)
- Wording: "Next.js encountered runtime/uncached data during the initial render"
  with streaming framing in description and build output
- Build messages: aligned with overlay wording, expanded fix list for agents
- Layout: removed sticky positioning, guidance flows naturally
- Updated ~235 inline snapshots across 9 test files to match new wording

Made-with: Cursor
- Fix isRuntimeVariant to match new message wording (checks
  "encountered runtime data" instead of old "Runtime data such as")
- Restore ErrorCause rendering in InstantRuntimeError (was missing
  the "Caused by: Instant Validation" section)
- Extract logBuildDebugHint into blocking-route-messages.ts and use
  it in both logDisallowedDynamicError and instant validation output

Made-with: Cursor
aurorascharff and others added 11 commits April 16, 2026 14:46
Add the "next dev" / "next build --debug-prerender" debug hint to all
71 instant-validation build snapshots across 3 test files.

Made-with: Cursor
Janka split dynamicBodyMessage into a shorter, more precise version
(just fetch/connection) and a fallback dynamicOrRuntimeBodyMessage.
Updates 53 inline snapshots across 3 test files.

Made-with: Cursor
Comment thread test/e2e/app-dir/instant-validation-causes/instant-validation-causes.test.ts Outdated
Comment thread packages/next/src/next-devtools/dev-overlay/container/errors.tsx
@aurorascharff aurorascharff merged commit e9bc619 into canary Apr 17, 2026
185 of 188 checks passed
@aurorascharff aurorascharff deleted the aurorascharff/instant-error-overhaul branch April 17, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants