Skip to content

[instant] Let dev-server requests bypass the fetch lock#95761

Merged
eps1lon merged 1 commit into
canaryfrom
sebbie/instant-api-dev-server-lock-005d24
Jul 20, 2026
Merged

[instant] Let dev-server requests bypass the fetch lock#95761
eps1lon merged 1 commit into
canaryfrom
sebbie/instant-api-dev-server-lock-005d24

Conversation

@eps1lon

@eps1lon eps1lon commented Jul 14, 2026

Copy link
Copy Markdown
Member

While an instant() testing scope is active, the navigation testing lock replaces window.fetch and queues every request until the scope ends. This also blocked the dev server's own client-side requests, i.e. everything served by the hot-reloader middlewares: the error overlay could not resolve stack frames via /__nextjs_original-stack-frames, source maps could not load via /__nextjs_source-map, and devtools actions like launch-editor hung for the whole scope.

The fix lets same-origin requests to /__nextjs_-prefixed paths (the shared prefix of all hot-reloader middleware endpoints) through the lock immediately.

Before:

CleanShot.2026-07-14.at.13.55.18.mp4

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Stats skipped

Commit: c4047c1
View workflow run

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: c4047c1

@eps1lon eps1lon changed the title Let dev-server requests bypass the instant() fetch lock [instant] Let dev-server requests bypass the fetch lock Jul 14, 2026
@eps1lon
eps1lon requested review from acdlite and Copilot and removed request for Copilot July 14, 2026 11:55
@eps1lon
eps1lon marked this pull request as ready for review July 14, 2026 11:55
@eps1lon
eps1lon enabled auto-merge (squash) July 19, 2026 23:25
@eps1lon
eps1lon force-pushed the sebbie/instant-api-dev-server-lock-005d24 branch from b35a2e3 to f225fc4 Compare July 19, 2026 23:27
While an instant() testing scope is active, the navigation testing lock
replaces `window.fetch` and queues every request until the scope ends. This
also blocked the dev server's own client-side requests, i.e. everything
served by the hot-reloader middlewares: the error overlay could not resolve
stack frames via `/__nextjs_original-stack-frames`, source maps could not
load via `/__nextjs_source-map`, and devtools actions like launch-editor
hung for the whole scope.

The fix lets same-origin requests to `/__nextjs_`-prefixed paths (the shared
prefix of all hot-reloader middleware endpoints) through the lock
immediately.
@eps1lon
eps1lon force-pushed the sebbie/instant-api-dev-server-lock-005d24 branch from f225fc4 to c4047c1 Compare July 19, 2026 23:28
@eps1lon
eps1lon merged commit 094dccb into canary Jul 20, 2026
225 of 230 checks passed
@eps1lon
eps1lon deleted the sebbie/instant-api-dev-server-lock-005d24 branch July 20, 2026 10:02
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.

2 participants