Skip to content

Add failing test for allow-runtime routes under the Instant Navigation lock#96029

Draft
gaojude wants to merge 1 commit into
canaryfrom
jude/instant-allow-runtime-regression-test
Draft

Add failing test for allow-runtime routes under the Instant Navigation lock#96029
gaojude wants to merge 1 commit into
canaryfrom
jude/instant-allow-runtime-regression-test

Conversation

@gaojude

@gaojude gaojude commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Adds a failing test demonstrating a regression from #95415: a route that opts into runtime prefetching (export const prefetch = 'allow-runtime') can no longer commit a navigation from a full link prefetch while the Instant Navigation lock is held.

The new fixture page is a copy of full-prefetch-target plus that single export, and the new test is a copy of the sibling full-prefetch test pointed at it. The sibling passes and the new test times out; under the lock the navigation commits nothing at all: not the prefetched content, not loading.tsx, and the source page stays on screen.

✓ renders full prefetch content instantly when prefetch={true} (122 ms)
✕ renders full prefetch content instantly when the target also allows runtime prefetching (20093 ms)

Reproduces in both dev and start modes. Bisected against published packages in an external repro: passes through 16.3.0-canary.87, fails from 16.3.0-canary.88 (the release containing #95415), under webpack as well as Turbopack. Request logs there show the router re-issuing prefetch requests it had already completed (identical _rsc cache-bust hashes) and then waiting on the dynamic request the lock withholds. v0 hit this on its canary bump and skipped the affected app test until this is fixed (vercel/v0#27128).

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Stats from current PR

🟢 1 improvement

Metric Canary PR Change Trend
Webpack Build Time (cached) 25.568s 24.941s 🟢 627ms (-2%) ▁▁▁█▁
📊 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) 762ms 812ms ▂▂▇▂▇
Cold (Ready in log) 765ms 783ms ▂▁█▁█
Cold (First Request) 1.292s 1.315s ▃▂█▁▇
Warm (Listen) 812ms 813ms ▁▁▇▁▇
Warm (Ready in log) 778ms 779ms ▂▁▇▁▇
Warm (First Request) 1.280s 1.289s ▂▁▇▁▇
📦 Dev Server (Webpack) (Legacy)

📦 Dev Server (Webpack)

Metric Canary PR Change Trend
Cold (Listen) 812ms 811ms ▁▁▂█▂
Cold (Ready in log) 774ms 768ms ▁▁▁█▁
Cold (First Request) 3.340s 3.326s ▁▁▁█▁
Warm (Listen) 762ms 760ms ▁▁▂█▂
Warm (Ready in log) 765ms 757ms ▁▁▁█▁
Warm (First Request) 3.339s 3.323s ▁▁▁█▁

⚡ Production Builds

Metric Canary PR Change Trend
Fresh Build 4.988s 5.177s ▄▁█▁▇
Cached Build 5.121s 5.178s ▃▃▇▁▇
📦 Production Builds (Webpack) (Legacy)

📦 Production Builds (Webpack)

Metric Canary PR Change Trend
Fresh Build 24.732s 24.904s ▁▁▁█▁
Cached Build 25.568s 24.941s 🟢 627ms (-2%) ▁▁▁█▁
node_modules Size 527 MB 527 MB █████
📦 Bundle Sizes

Bundle Sizes

⚡ Turbopack

Client

Main Bundles
Canary PR Change
03frh1tm1pkvs.js gzip 65.6 kB N/A -
0a-p0meqxynjz.js gzip 10.3 kB N/A -
0avtke4yefj4-.js gzip 13.1 kB N/A -
0ban--bx2qns6.js gzip 155 B N/A -
0cz1d0mv5g_q7.js gzip 39.4 kB 39.4 kB
0ke29q58efn1a.js gzip 156 B N/A -
0m3evdsbel0p0.js gzip 153 B N/A -
0p6ivy9lb7-ut.js gzip 157 B N/A -
0pt5of3ch6d2u.js gzip 13.6 kB N/A -
0sug3ihj23mvn.js gzip 154 B N/A -
0xnsdo-6y9r3k.js gzip 5.72 kB N/A -
0y25v1ej71uft.js gzip 155 B N/A -
0yi7is8u4covm.js gzip 8.77 kB N/A -
12zd-d7xicsb4.js gzip 158 B N/A -
1elt1qium-r2m.css gzip 115 B 115 B
1g2ea05dkmmwi.js gzip 45.2 kB N/A -
1mqxdmso4160h.js gzip 160 B N/A -
1prv-wg6jgtt2.js gzip 8.77 kB N/A -
1t47vod02e_4a.js gzip 8.75 kB N/A -
1tf1phijqlx9j.js gzip 220 B 220 B
1tw002sq5bo4l.js gzip 10 kB N/A -
1wlerik1n7zbr.js gzip 8.7 kB N/A -
2d91wcgx6lf2k.js gzip 153 B N/A -
2koflviradwt3.js gzip 7.4 kB N/A -
2lviwqiqxm904.js gzip 3.52 kB N/A -
2ocpv0tylryvn.js gzip 160 B N/A -
2pevdqjpbf3xk.js gzip 9.45 kB N/A -
2qd2anu9eizlz.js gzip 8.75 kB N/A -
2sv39ae5_8vfj.js gzip 8.81 kB N/A -
2utx6n7w65xqa.js gzip 8.7 kB N/A -
2xsvwiy3-s105.js gzip 156 B N/A -
2zhsfsomo6g1v.js gzip 169 B N/A -
3-ukivglqkfeq.js gzip 8.78 kB N/A -
325xisqrylugu.js gzip 450 B N/A -
3jc9ghvds1spf.js gzip 2.29 kB N/A -
3juwkvkgvywfe.js gzip 10.6 kB N/A -
3kbove7q58uqh.js gzip 13.2 kB N/A -
3qn7vntp30gaj.js gzip 1.47 kB N/A -
3s5fbzg2qit8e.js gzip 156 B N/A -
3xtfvhlgn22av.js gzip 71.1 kB N/A -
turbopack-0z.._-wk.js gzip 3.78 kB N/A -
turbopack-0z..g5ya.js gzip 3.8 kB N/A -
turbopack-10..hlo9.js gzip 3.8 kB N/A -
turbopack-11..yksz.js gzip 3.81 kB N/A -
turbopack-1k..5le3.js gzip 3.8 kB N/A -
turbopack-2p..8e3n.js gzip 3.8 kB N/A -
turbopack-2s..l7od.js gzip 3.8 kB N/A -
turbopack-2u..c9m0.js gzip 3.8 kB N/A -
turbopack-39..3ysu.js gzip 3.8 kB N/A -
turbopack-3i..u_md.js gzip 3.8 kB N/A -
turbopack-3l..z_a8.js gzip 3.81 kB N/A -
turbopack-3w..t926.js gzip 3.8 kB N/A -
turbopack-3y..v370.js gzip 3.82 kB N/A -
turbopack-40..h7ed.js gzip 3.8 kB N/A -
030a1njeh5b77.js gzip N/A 10 kB -
0ceaj3rmii5dl.js gzip N/A 157 B -
0ot0qt5np20h7.js gzip N/A 8.78 kB -
0po7u01wwhl8s.js gzip N/A 157 B -
12m9rr7_7cexd.js gzip N/A 8.7 kB -
15-b7iytymgp5.js gzip N/A 65.6 kB -
186r3y_rfvr0b.js gzip N/A 8.78 kB -
19v97848yrjp7.js gzip N/A 8.81 kB -
1b9oo_n-opj3l.js gzip N/A 156 B -
1mvdo2etbyclo.js gzip N/A 156 B -
1nd_0rwgz2ozk.js gzip N/A 9.45 kB -
1oi9pltr_e10m.js gzip N/A 10.6 kB -
1qow5vb4es1bl.js gzip N/A 152 B -
1rd9tzqgzsz2w.js gzip N/A 8.77 kB -
1rewgj8du8r7b.js gzip N/A 157 B -
1rq1g_cwv642d.js gzip N/A 10.3 kB -
1uojw_uabeg93.js gzip N/A 450 B -
1w-7lusgyl81y.js gzip N/A 8.7 kB -
2-4bvun4utbsg.js gzip N/A 157 B -
20pls2cco-oyl.js gzip N/A 71.1 kB -
21h56wdn9zddo.js gzip N/A 8.75 kB -
21kc-4x8zf_oh.js gzip N/A 155 B -
22nt-vwpfkpq5.js gzip N/A 155 B -
2j9dbydew6g_b.js gzip N/A 162 B -
2lg10omv7xu14.js gzip N/A 3.52 kB -
2ovff1533zvno.js gzip N/A 13.2 kB -
2s4z8jy0z7v93.js gzip N/A 1.46 kB -
2y6gb5bs4mnam.js gzip N/A 8.75 kB -
2zvoj8k1z3cei.js gzip N/A 7.41 kB -
341h71ln1jpl3.js gzip N/A 2.29 kB -
34ttpt_n7605h.js gzip N/A 5.72 kB -
36ckfq9o-ys-a.js gzip N/A 13.1 kB -
37pm_isc9xj9i.js gzip N/A 163 B -
3vdh6_u50pu5t.js gzip N/A 13.6 kB -
3zbnmofunn_bw.js gzip N/A 158 B -
441_xec6sd6zp.js gzip N/A 45.1 kB -
45148p5lps61x.js gzip N/A 170 B -
turbopack-00..m1m7.js gzip N/A 3.81 kB -
turbopack-0d..4kzx.js gzip N/A 3.81 kB -
turbopack-0z..p79s.js gzip N/A 3.81 kB -
turbopack-1c..77uv.js gzip N/A 3.81 kB -
turbopack-1i..3kn6.js gzip N/A 3.81 kB -
turbopack-2d..v5q3.js gzip N/A 3.82 kB -
turbopack-2f..v9c_.js gzip N/A 3.78 kB -
turbopack-2k..d454.js gzip N/A 3.81 kB -
turbopack-2t..j9f5.js gzip N/A 3.81 kB -
turbopack-3_..5w5s.js gzip N/A 3.81 kB -
turbopack-39..bm8d.js gzip N/A 3.81 kB -
turbopack-3e..0dhh.js gzip N/A 3.8 kB -
turbopack-3t..czon.js gzip N/A 3.81 kB -
turbopack-3v..bfyi.js gzip N/A 3.81 kB -
Total 448 kB 448 kB ⚠️ +98 B

Server

Middleware
Canary PR Change
middleware-b..fest.js gzip 778 B 777 B
Total 778 B 777 B ✅ -1 B
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 436 B 435 B
Total 436 B 435 B ✅ -1 B

📦 Webpack

Client

Main Bundles
Canary PR Change
3322-HASH.js gzip 63.7 kB N/A -
4191.HASH.js gzip 169 B N/A -
7920-HASH.js gzip 4.68 kB N/A -
9784-HASH.js gzip 5.63 kB N/A -
b1ad9f4c-HASH.js gzip 62.9 kB N/A -
framework-HASH.js gzip 59.7 kB 59.7 kB
main-app-HASH.js gzip 254 B 254 B
main-HASH.js gzip 40 kB 40 kB
webpack-HASH.js gzip 1.68 kB 1.68 kB
3577.HASH.js gzip N/A 168 B -
578-HASH.js gzip N/A 64.4 kB -
8590-HASH.js gzip N/A 5.61 kB -
9750-HASH.js gzip N/A 4.69 kB -
a8984546-HASH.js gzip N/A 62.9 kB -
Total 239 kB 239 kB ⚠️ +631 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 194 B 193 B
_error-HASH.js gzip 181 B 182 B
css-HASH.js gzip 334 B 331 B
dynamic-HASH.js gzip 1.81 kB 1.81 kB
edge-ssr-HASH.js gzip 255 B 253 B
head-HASH.js gzip 349 B 351 B
hooks-HASH.js gzip 382 B 384 B
image-HASH.js gzip 581 B 582 B
index-HASH.js gzip 260 B 259 B
link-HASH.js gzip 2.48 kB 2.48 kB
routerDirect..HASH.js gzip 317 B 318 B
script-HASH.js gzip 384 B 386 B
withRouter-HASH.js gzip 316 B 315 B
1afbb74e6ecf..834.css gzip 106 B 106 B
Total 7.95 kB 7.95 kB ⚠️ +1 B

Server

Edge SSR
Canary PR Change
edge-ssr.js gzip 128 kB 128 kB
page.js gzip 287 kB 287 kB
Total 415 kB 414 kB ✅ -601 B
Middleware
Canary PR Change
middleware-b..fest.js gzip 617 B 615 B
middleware-r..fest.js gzip 156 B 156 B
middleware.js gzip 45.5 kB 45.1 kB
edge-runtime..pack.js gzip 842 B 842 B
Total 47.1 kB 46.7 kB ✅ -419 B
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 718 B 718 B
Total 718 B 718 B
Build Cache
Canary PR Change
0.pack gzip 4.82 MB 4.82 MB
index.pack gzip 118 kB 118 kB
index.pack.old gzip 120 kB 119 kB
Total 5.05 MB 5.05 MB ✅ -1.47 kB

🔄 Shared (bundler-independent)

Runtimes
Canary PR Change
app-page-exp...dev.js gzip 366 kB 366 kB
app-page-exp..prod.js gzip 202 kB 202 kB
app-page-tur...dev.js gzip 365 kB 365 kB
app-page-tur..prod.js gzip 202 kB 202 kB
app-page-tur...dev.js gzip 362 kB 362 kB
app-page-tur..prod.js gzip 200 kB 200 kB
app-page.run...dev.js gzip 362 kB 362 kB
app-page.run..prod.js gzip 200 kB 200 kB
app-route-ex...dev.js gzip 81.7 kB 81.7 kB
app-route-ex..prod.js gzip 55.6 kB 55.6 kB
app-route-tu...dev.js gzip 81.8 kB 81.8 kB
app-route-tu..prod.js gzip 55.6 kB 55.6 kB
app-route-tu...dev.js gzip 81.4 kB 81.4 kB
app-route-tu..prod.js gzip 55.4 kB 55.4 kB
app-route.ru...dev.js gzip 81.3 kB 81.3 kB
app-route.ru..prod.js gzip 55.3 kB 55.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 45.4 kB 45.4 kB
pages-api-tu..prod.js gzip 34.1 kB 34.1 kB
pages-api.ru...dev.js gzip 45.4 kB 45.4 kB
pages-api.ru..prod.js gzip 34.1 kB 34.1 kB
pages-turbo....dev.js gzip 54.9 kB 54.9 kB
pages-turbo...prod.js gzip 39.7 kB 39.7 kB
pages.runtim...dev.js gzip 54.8 kB 54.8 kB
pages.runtim..prod.js gzip 39.7 kB 39.7 kB
server.runti..prod.js gzip 67.8 kB 67.8 kB
use-cache-pr...dev.js gzip 71.6 kB 71.6 kB
use-cache-pr...dev.js gzip 71.6 kB 71.6 kB
use-cache-pr...dev.js gzip 69.9 kB 69.9 kB
use-cache-pr...dev.js gzip 69.9 kB 69.9 kB
Total 3.51 MB 3.51 MB
📎 Tarball URL
https://vercel-packages.vercel.app/next/commits/2f9edc55faafecb812401d1c7ae4bb95c0b59b08/next

Commit: 2f9edc5

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Failing test suites

Commit: 2f9edc5 | About building and testing Next.js

pnpm test-dev-experimental-turbo test/e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts (job)

  • instant-navigation-testing-api > renders full prefetch content instantly when the target also allows runtime prefetching (DD)
Expand output

● instant-navigation-testing-api › renders full prefetch content instantly when the target also allows runtime prefetching

locator.waitFor: Timeout 20000ms exceeded.
Call log:
  - waiting for locator('[data-testid="full-prefetch-runtime-content"]') to be visible

  265 |         '[data-testid="full-prefetch-runtime-content"]'
  266 |       )
> 267 |       await content.waitFor({ state: 'visible' })
      |                     ^
  268 |       expect(await content.textContent()).toContain(
  269 |         'Full prefetch runtime content loaded'
  270 |       )

  at waitFor (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:267:21)
  at instant (../packages/next-playwright/dist/index.js:75:20)
  at Object.<anonymous> (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:259:5)

pnpm test-start-experimental-turbo test/e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts (job)

  • instant-navigation-testing-api > renders full prefetch content instantly when the target also allows runtime prefetching (DD)
Expand output

● instant-navigation-testing-api › renders full prefetch content instantly when the target also allows runtime prefetching

locator.waitFor: Timeout 20000ms exceeded.
Call log:
  - waiting for locator('[data-testid="full-prefetch-runtime-content"]') to be visible

  265 |         '[data-testid="full-prefetch-runtime-content"]'
  266 |       )
> 267 |       await content.waitFor({ state: 'visible' })
      |                     ^
  268 |       expect(await content.textContent()).toContain(
  269 |         'Full prefetch runtime content loaded'
  270 |       )

  at waitFor (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:267:21)
  at instant (../packages/next-playwright/dist/index.js:75:20)
  at Object.<anonymous> (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:259:5)

pnpm test-dev test/e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts (job)

  • instant-navigation-testing-api > renders full prefetch content instantly when the target also allows runtime prefetching (DD)
Expand output

● instant-navigation-testing-api › renders full prefetch content instantly when the target also allows runtime prefetching

locator.waitFor: Timeout 20000ms exceeded.
Call log:
  - waiting for locator('[data-testid="full-prefetch-runtime-content"]') to be visible

  265 |         '[data-testid="full-prefetch-runtime-content"]'
  266 |       )
> 267 |       await content.waitFor({ state: 'visible' })
      |                     ^
  268 |       expect(await content.textContent()).toContain(
  269 |         'Full prefetch runtime content loaded'
  270 |       )

  at waitFor (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:267:21)
  at instant (../packages/next-playwright/dist/index.js:75:20)
  at Object.<anonymous> (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:259:5)

pnpm test-dev test/e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts (job)

  • instant-navigation-testing-api > renders full prefetch content instantly when the target also allows runtime prefetching (DD)
Expand output

● instant-navigation-testing-api › renders full prefetch content instantly when the target also allows runtime prefetching

locator.waitFor: Timeout 20000ms exceeded.
Call log:
  - waiting for locator('[data-testid="full-prefetch-runtime-content"]') to be visible

  265 |         '[data-testid="full-prefetch-runtime-content"]'
  266 |       )
> 267 |       await content.waitFor({ state: 'visible' })
      |                     ^
  268 |       expect(await content.textContent()).toContain(
  269 |         'Full prefetch runtime content loaded'
  270 |       )

  at waitFor (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:267:21)
  at instant (../packages/next-playwright/dist/index.js:75:20)
  at Object.<anonymous> (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:259:5)

pnpm test-start test/e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts (job)

  • instant-navigation-testing-api > renders full prefetch content instantly when the target also allows runtime prefetching (DD)
Expand output

● instant-navigation-testing-api › renders full prefetch content instantly when the target also allows runtime prefetching

locator.waitFor: Timeout 20000ms exceeded.
Call log:
  - waiting for locator('[data-testid="full-prefetch-runtime-content"]') to be visible

  265 |         '[data-testid="full-prefetch-runtime-content"]'
  266 |       )
> 267 |       await content.waitFor({ state: 'visible' })
      |                     ^
  268 |       expect(await content.textContent()).toContain(
  269 |         'Full prefetch runtime content loaded'
  270 |       )

  at waitFor (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:267:21)
  at instant (../packages/next-playwright/dist/index.js:75:20)
  at Object.<anonymous> (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:259:5)

pnpm test-start test/e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts (job)

  • instant-navigation-testing-api > renders full prefetch content instantly when the target also allows runtime prefetching (DD)
Expand output

● instant-navigation-testing-api › renders full prefetch content instantly when the target also allows runtime prefetching

locator.waitFor: Timeout 20000ms exceeded.
Call log:
  - waiting for locator('[data-testid="full-prefetch-runtime-content"]') to be visible

  265 |         '[data-testid="full-prefetch-runtime-content"]'
  266 |       )
> 267 |       await content.waitFor({ state: 'visible' })
      |                     ^
  268 |       expect(await content.textContent()).toContain(
  269 |         'Full prefetch runtime content loaded'
  270 |       )

  at waitFor (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:267:21)
  at instant (../packages/next-playwright/dist/index.js:75:20)
  at Object.<anonymous> (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:259:5)

pnpm test-dev-turbo test/e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts (turbopack) (job)

  • instant-navigation-testing-api > renders full prefetch content instantly when the target also allows runtime prefetching (DD)
Expand output

● instant-navigation-testing-api › renders full prefetch content instantly when the target also allows runtime prefetching

locator.waitFor: Timeout 20000ms exceeded.
Call log:
  - waiting for locator('[data-testid="full-prefetch-runtime-content"]') to be visible

  265 |         '[data-testid="full-prefetch-runtime-content"]'
  266 |       )
> 267 |       await content.waitFor({ state: 'visible' })
      |                     ^
  268 |       expect(await content.textContent()).toContain(
  269 |         'Full prefetch runtime content loaded'
  270 |       )

  at waitFor (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:267:21)
  at instant (../packages/next-playwright/dist/index.js:75:20)
  at Object.<anonymous> (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:259:5)

pnpm test-start-turbo test/e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts (turbopack) (job)

  • instant-navigation-testing-api > renders full prefetch content instantly when the target also allows runtime prefetching (DD)
Expand output

● instant-navigation-testing-api › renders full prefetch content instantly when the target also allows runtime prefetching

locator.waitFor: Timeout 20000ms exceeded.
Call log:
  - waiting for locator('[data-testid="full-prefetch-runtime-content"]') to be visible

  265 |         '[data-testid="full-prefetch-runtime-content"]'
  266 |       )
> 267 |       await content.waitFor({ state: 'visible' })
      |                     ^
  268 |       expect(await content.textContent()).toContain(
  269 |         'Full prefetch runtime content loaded'
  270 |       )

  at waitFor (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:267:21)
  at instant (../packages/next-playwright/dist/index.js:75:20)
  at Object.<anonymous> (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:259:5)

@gaojude

gaojude commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Traced the mechanism by instrumenting the published canary.92 client in the external repro (dev mode, console checkpoints). Chain:

  1. Unify appShells flag with Partial Prefetching #95415 widened PrefetchHint.SubtreeHasPartialPrefetching to include prefetch: 'allow-runtime' segments (app-router-types.ts; previously only truthy instant configs set it).
  2. For hinted routes the scheduler ignores the link's Full strategy (scheduler.ts, "a 'full' prefetch () has no effect. You're meant to use Runtime Prefetching instead"). That downgrade now applies to allow-runtime routes, whose pattern relies on the full link prefetch. Instrumentation confirms: strategy downgraded to PPR from 4 on every pass.
  3. The downgraded flow spawns a PPRRuntime request. With Cached Navigations metadata present (auto-enabled by cacheComponents), fetchSegmentPrefetchesUsingDynamicRequest calls resolveShellStageData, which does const shellByteLength = await flightResponse.a. On this runtime-prefetch response the a row exists as a promise but never resolves, so response processing hangs forever and the spawned entries never fulfill or reject. Checkpoint log ends at shellStage: a is a promise, awaiting...; the sibling RuntimeShell request resolves null and completes normally.
  4. Under the Instant Navigation lock, ensurePrefetchThenNavigate awaits every spawned entry before navigating, so the navigation never starts and nothing commits, not even loading.tsx. The lock-prefetch refcount sticks at 2, exactly the two PPRRuntime entries. Without the lock the navigation falls back to its own dynamic request, so production loses the prefetched instant nav silently instead of hanging.

So there are two layers: an intended semantic shift (full prefetch superseded on partial-prefetching routes) and a bug in the replacement path (the unresolved flightResponse.a await deadlocks runtime-prefetch response processing for these routes; the entries also stay pending in the cache indefinitely). Config ablations that do not help: experimental.partialPrefetching: true, disabling cachedNavigations, instant: true, and instant: { unstable_samples: [{}] } on the page.

@gaojude

gaojude commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Production impact without the lock, same repro, measured by counting dynamic RSC requests (rsc header, no prefetch header) between the link click and the marker paint after the prefetch settled: canary.85 paints with 0 dynamic requests (served from the prefetched cache), canary.92 paints only after 1 fresh dynamic request. So outside the testing API the page still renders and nothing errors, but the navigation is no longer instant: the full link prefetch on an allow-runtime route no longer produces data the navigation can use. The instant() hang is the loud version of this silent regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant