Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DevOverlay]: enable by default #75882

Merged
merged 15 commits into from
Feb 13, 2025
Merged

Conversation

ztanner
Copy link
Member

@ztanner ztanner commented Feb 10, 2025

  • newDevOverlay: true by default (enables experimental React builds on canary until owner stacks progress further)
  • run-tests now sets the env var for tests that were relying on it for forking behavior
  • PPR runners now run with the flag disabled to help catch regressions in the old overlay until we remove it
  • Fixed a number of tests that had outdated snapshots or missed forking behavior because they weren't running in CI
  • Disabled a test that was failing in Turbopack + Experimental React that is unrelated to the overlay (see: debug failing test for turbopack+experimental react #75989)

@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. type: next labels Feb 10, 2025
Copy link
Member Author

ztanner commented Feb 10, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ztanner ztanner closed this Feb 10, 2025
@ztanner ztanner deleted the 02-10-_devoverlay_enable_by_default branch February 10, 2025 21:00
@ztanner ztanner restored the 02-10-_devoverlay_enable_by_default branch February 10, 2025 23:22
@ztanner ztanner reopened this Feb 10, 2025
@ztanner ztanner force-pushed the 02-10-_devoverlay_enable_by_default branch from e142add to 5f0354b Compare February 10, 2025 23:34
@ijjk
Copy link
Member

ijjk commented Feb 10, 2025

Failing test suites

Commit: 799111c

pnpm test-dev-turbo test/e2e/app-dir/next-after-app-api-usage/index.test.ts (turbopack)

  • nextjs APIs in after() > request APIs inside after() > cannot be called in a dynamic page
  • nextjs APIs in after() > request APIs inside after() > cannot be called in a prerendered page > with dynamic = "error"
  • nextjs APIs in after() > request APIs inside after() > cannot be called in a prerendered page > with dynamic = "force-static"
Expand output

● nextjs APIs in after() › request APIs inside after() › cannot be called in a dynamic page

expect(received).toContain(expected) // indexOf

Expected substring: "[/request-apis/page-dynamic] nested connection(): error: Error: Route /request-apis/page-dynamic used \"connection\" inside \"after(...)\"."
Received string:    "   Loading config from /tmp/next-install-dfaacf5fee999b59683f3aee210aed5c4e2582d69d6956e1f6d562ac453fcd06/next.config.js
 ○ Compiling /request-apis/page-dynamic ...
 ✓ Compiled /request-apis/page-dynamic in 2.4s
 GET /request-apis/page-dynamic 200 in 2970ms
[/request-apis/page-dynamic] headers(): error: Error: Route /request-apis/page-dynamic used \"headers\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"headers\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after

  at <unknown> (../app/request-apis/helpers.js:7:18)
     5 |   after(async () => {
     6 |     try {
  >  7 |       await headers()
       |                  ^
     8 |       console.log(`[${route}] headers(): ok`)
     9 |     } catch (err) {
    10 |       console.error(`[${route}] headers(): error:`, err)
  [/request-apis/page-dynamic] cookies(): error: Error: Route /request-apis/page-dynamic used \"cookies\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"cookies\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:27:18)
  at <unknown> (../app/request-apis/helpers.js:15:10)
    25 |   after(async () => {
    26 |     try {
  > 27 |       await cookies()
       |                  ^
    28 |       console.log(`[${route}] cookies(): ok`)
    29 |     } catch (err) {
    30 |       console.error(`[${route}] cookies(): error:`, err)
  [/request-apis/page-dynamic] connection(): error: Error: Route /request-apis/page-dynamic used \"connection\" inside \"after(...)\". The `connection()` function is used to indicate the subsequent code must only run when there is an actual Request, but \"after(...)\" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:47:21)
  at <unknown> (../app/request-apis/helpers.js:35:10)
    45 |   after(async () => {
    46 |     try {
  > 47 |       await connection()
       |                     ^
    48 |       console.log(`[${route}] connection(): ok`)
    49 |     } catch (err) {
    50 |       console.error(`[${route}] connection(): error:`, err)
  [/request-apis/page-dynamic] nested headers(): error: Error: Route /request-apis/page-dynamic used \"headers\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"headers\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:17:20)
  at <unknown> (../app/request-apis/helpers.js:55:10)
    15 |     after(async () => {
    16 |       try {
  > 17 |         await headers()
       |                    ^
    18 |         console.log(`[${route}] nested headers(): ok`)
    19 |       } catch (err) {
    20 |         console.error(`[${route}] nested headers(): error:`, err)
  [/request-apis/page-dynamic] nested cookies(): error: Error: Route /request-apis/page-dynamic used \"cookies\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"cookies\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:37:20)
    35 |     after(async () => {
    36 |       try {
  > 37 |         await cookies()
       |                    ^
    38 |         console.log(`[${route}] nested cookies(): ok`)
    39 |       } catch (err) {
    40 |         console.error(`[${route}] nested cookies(): error:`, err)
  "
  at toContain (e2e/app-dir/next-after-app-api-usage/index.test.ts:82:22)
  at fn (lib/next-test-utils.ts:807:20)
  at Object.<anonymous> (e2e/app-dir/next-after-app-api-usage/index.test.ts:53:7)

● nextjs APIs in after() › request APIs inside after() › cannot be called in a prerendered page › with dynamic = "error"

expect(received).toContain(expected) // indexOf

Expected substring: "[/request-apis/page-dynamic-error] nested cookies(): error: Error: Route /request-apis/page-dynamic-error used \"cookies\" inside \"after(...)\". This is not supported."
Received string:    "[/request-apis/page-dynamic] nested connection(): error: Error: Route /request-apis/page-dynamic used \"connection\" inside \"after(...)\". The `connection()` function is used to indicate the subsequent code must only run when there is an actual Request, but \"after(...)\" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after

  at <unknown> (../app/request-apis/helpers.js:57:23)
    55 |     after(async () => {
    56 |       try {
  > 57 |         await connection()
       |                       ^
    58 |         console.log(`[${route}] nested connection(): ok`)
    59 |       } catch (err) {
    60 |         console.error(`[${route}] nested connection(): error:`, err)
   ○ Compiling /request-apis/page-dynamic-error ...
   ✓ Compiled /request-apis/page-dynamic-error in 1106ms
   GET /request-apis/page-dynamic-error 200 in 1356ms
  [/request-apis/page-dynamic-error] headers(): error: Error: Route /request-apis/page-dynamic-error used \"headers\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"headers\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:7:18)
     5 |   after(async () => {
     6 |     try {
  >  7 |       await headers()
       |                  ^
     8 |       console.log(`[${route}] headers(): ok`)
     9 |     } catch (err) {
    10 |       console.error(`[${route}] headers(): error:`, err)
  [/request-apis/page-dynamic-error] cookies(): error: Error: Route /request-apis/page-dynamic-error used \"cookies\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"cookies\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:27:18)
  at <unknown> (../app/request-apis/helpers.js:15:10)
    25 |   after(async () => {
    26 |     try {
  > 27 |       await cookies()
       |                  ^
    28 |       console.log(`[${route}] cookies(): ok`)
    29 |     } catch (err) {
    30 |       console.error(`[${route}] cookies(): error:`, err)
  [/request-apis/page-dynamic-error] connection(): error: Error: Route /request-apis/page-dynamic-error used \"connection\" inside \"after(...)\". The `connection()` function is used to indicate the subsequent code must only run when there is an actual Request, but \"after(...)\" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:47:21)
  at <unknown> (../app/request-apis/helpers.js:35:10)
    45 |   after(async () => {
    46 |     try {
  > 47 |       await connection()
       |                     ^
    48 |       console.log(`[${route}] connection(): ok`)
    49 |     } catch (err) {
    50 |       console.error(`[${route}] connection(): error:`, err)
  [/request-apis/page-dynamic-error] nested headers(): error: Error: Route /request-apis/page-dynamic-error used \"headers\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"headers\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:17:20)
  at <unknown> (../app/request-apis/helpers.js:55:10)
    15 |     after(async () => {
    16 |       try {
  > 17 |         await headers()
       |                    ^
    18 |         console.log(`[${route}] nested headers(): ok`)
    19 |       } catch (err) {
    20 |         console.error(`[${route}] nested headers(): error:`, err)
  "
  at toContain (e2e/app-dir/next-after-app-api-usage/index.test.ts:119:24)
  at fn (lib/next-test-utils.ts:807:20)
  at e2e/app-dir/next-after-app-api-usage/index.test.ts:100:9

● nextjs APIs in after() › request APIs inside after() › cannot be called in a prerendered page › with dynamic = "force-static"

expect(received).toContain(expected) // indexOf

Expected substring: "[/request-apis/page-force-static] nested cookies(): error: Error: Route /request-apis/page-force-static used \"cookies\" inside \"after(...)\". This is not supported."
Received string:    "[/request-apis/page-dynamic-error] nested cookies(): error: Error: Route /request-apis/page-dynamic-error used \"cookies\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"cookies\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after

  at <unknown> (../app/request-apis/helpers.js:37:20)
    35 |     after(async () => {
    36 |       try {
  > 37 |         await cookies()
       |                    ^
    38 |         console.log(`[${route}] nested cookies(): ok`)
    39 |       } catch (err) {
    40 |         console.error(`[${route}] nested cookies(): error:`, err)
  [/request-apis/page-dynamic-error] nested connection(): error: Error: Route /request-apis/page-dynamic-error used \"connection\" inside \"after(...)\". The `connection()` function is used to indicate the subsequent code must only run when there is an actual Request, but \"after(...)\" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:57:23)
    55 |     after(async () => {
    56 |       try {
  > 57 |         await connection()
       |                       ^
    58 |         console.log(`[${route}] nested connection(): ok`)
    59 |       } catch (err) {
    60 |         console.error(`[${route}] nested connection(): error:`, err)
   ○ Compiling /request-apis/page-force-static ...
   ✓ Compiled /request-apis/page-force-static in 901ms
   GET /request-apis/page-force-static 200 in 1055ms
  [/request-apis/page-force-static] headers(): error: Error: Route /request-apis/page-force-static used \"headers\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"headers\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:7:18)
     5 |   after(async () => {
     6 |     try {
  >  7 |       await headers()
       |                  ^
     8 |       console.log(`[${route}] headers(): ok`)
     9 |     } catch (err) {
    10 |       console.error(`[${route}] headers(): error:`, err)
  [/request-apis/page-force-static] cookies(): error: Error: Route /request-apis/page-force-static used \"cookies\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"cookies\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:27:18)
  at <unknown> (../app/request-apis/helpers.js:15:10)
    25 |   after(async () => {
    26 |     try {
  > 27 |       await cookies()
       |                  ^
    28 |       console.log(`[${route}] cookies(): ok`)
    29 |     } catch (err) {
    30 |       console.error(`[${route}] cookies(): error:`, err)
  [/request-apis/page-force-static] connection(): error: Error: Route /request-apis/page-force-static used \"connection\" inside \"after(...)\". The `connection()` function is used to indicate the subsequent code must only run when there is an actual Request, but \"after(...)\" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:47:21)
  at <unknown> (../app/request-apis/helpers.js:35:10)
    45 |   after(async () => {
    46 |     try {
  > 47 |       await connection()
       |                     ^
    48 |       console.log(`[${route}] connection(): ok`)
    49 |     } catch (err) {
    50 |       console.error(`[${route}] connection(): error:`, err)
  [/request-apis/page-force-static] nested headers(): error: Error: Route /request-apis/page-force-static used \"headers\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"headers\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:17:20)
  at <unknown> (../app/request-apis/helpers.js:55:10)
    15 |     after(async () => {
    16 |       try {
  > 17 |         await headers()
       |                    ^
    18 |         console.log(`[${route}] nested headers(): ok`)
    19 |       } catch (err) {
    20 |         console.error(`[${route}] nested headers(): error:`, err)
  "
  at toContain (e2e/app-dir/next-after-app-api-usage/index.test.ts:119:24)
  at fn (lib/next-test-utils.ts:807:20)
  at e2e/app-dir/next-after-app-api-usage/index.test.ts:100:9

Read more about building and testing Next.js in contributing.md.

pnpm test-dev test/e2e/app-dir/rsc-basic/rsc-basic.test.ts

  • app dir - rsc basics > should be able to navigate between rsc routes
Expand output

● app dir - rsc basics › should be able to navigate between rsc routes

request.allHeaders: Target page, context or browser has been closed

  164 |         page.on('request', (request) => {
  165 |           requestsCount++
> 166 |           return request.allHeaders().then((headers) => {
      |                          ^
  167 |             if (
  168 |               headers['RSC'.toLowerCase()] === '1' &&
  169 |               // Prefetches also include `RSC`

  at Page.allHeaders (e2e/app-dir/rsc-basic/rsc-basic.test.ts:166:26)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev test/development/acceptance-app/hydration-error.test.ts

  • Error overlay for hydration errors in App router > should show error if script is directly placed under html instead of body
Expand output

● Error overlay for hydration errors in App router › should show error if script is directly placed under html instead of body

page.goto: Timeout 60000ms exceeded.
Call log:
  - navigating to "http://localhost:37395/", waiting until "load"

  290 |     opts?.beforePageLoad?.(page)
  291 |
> 292 |     await page.goto(url, { waitUntil: 'load' })
      |                ^
  293 |   }
  294 |
  295 |   back(options) {

  at BrowserInterface.goto (lib/browsers/playwright.ts:292:16)
  at webdriver (lib/next-webdriver.ts:136:3)
  at createSandbox (lib/development-sandbox.ts:52:21)
  at Object.<anonymous> (development/acceptance-app/hydration-error.test.ts:840:27)

● Test suite failed to run

You must use `using` to create a sandbox, i.e., `await using sandbox = await createSandbox(`

  170 |     setImmediate(() => {
  171 |       if (!unwrappedByTypeScriptUsingKeyword) {
> 172 |         throw new Error(
      |               ^
  173 |           'You must use `using` to create a sandbox, i.e., `await using sandbox = await createSandbox(`'
  174 |         )
  175 |       }

  at Immediate.<anonymous> (lib/development-sandbox.ts:172:15)

Read more about building and testing Next.js in contributing.md.

@ijjk
Copy link
Member

ijjk commented Feb 10, 2025

Stats from current PR

Default Build (Increase detected ⚠️)
General
vercel/next.js canary vercel/next.js 02-10-_devoverlay_enable_by_default Change
buildDuration 18.7s 17s N/A
buildDurationCached 16.1s 13.6s N/A
nodeModulesSize 393 MB 393 MB N/A
nextStartRea..uration (ms) 458ms 451ms N/A
Client Bundles (main, webpack) Overall increase ⚠️
vercel/next.js canary vercel/next.js 02-10-_devoverlay_enable_by_default Change
5306-HASH.js gzip 55.1 kB 55.4 kB ⚠️ +333 B
7048.HASH.js gzip 168 B 168 B
8377-HASH.js gzip 5.46 kB 5.46 kB N/A
bccd1874-HASH.js gzip 53 kB 56.9 kB ⚠️ +3.93 kB
framework-HASH.js gzip 57.5 kB 57.5 kB N/A
main-app-HASH.js gzip 245 B 247 B N/A
main-HASH.js gzip 34.7 kB 34.9 kB ⚠️ +187 B
webpack-HASH.js gzip 1.71 kB 1.71 kB
Overall change 145 kB 149 kB ⚠️ +4.45 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js 02-10-_devoverlay_enable_by_default Change
polyfills-HASH.js gzip 39.4 kB 39.4 kB
Overall change 39.4 kB 39.4 kB
Client Pages
vercel/next.js canary vercel/next.js 02-10-_devoverlay_enable_by_default Change
_app-HASH.js gzip 194 B 194 B
_error-HASH.js gzip 193 B 192 B N/A
amp-HASH.js gzip 513 B 511 B N/A
css-HASH.js gzip 342 B 342 B
dynamic-HASH.js gzip 1.84 kB 1.84 kB N/A
edge-ssr-HASH.js gzip 265 B 264 B N/A
head-HASH.js gzip 363 B 360 B N/A
hooks-HASH.js gzip 393 B 390 B N/A
image-HASH.js gzip 4.59 kB 4.59 kB N/A
index-HASH.js gzip 268 B 266 B N/A
link-HASH.js gzip 2.35 kB 2.35 kB
routerDirect..HASH.js gzip 327 B 326 B N/A
script-HASH.js gzip 397 B 397 B
withRouter-HASH.js gzip 325 B 325 B
1afbb74e6ecf..834.css gzip 106 B 106 B
Overall change 3.72 kB 3.72 kB
Client Build Manifests
vercel/next.js canary vercel/next.js 02-10-_devoverlay_enable_by_default Change
_buildManifest.js gzip 749 B 747 B N/A
Overall change 0 B 0 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js 02-10-_devoverlay_enable_by_default Change
index.html gzip 522 B 522 B
link.html gzip 539 B 536 B N/A
withRouter.html gzip 519 B 517 B N/A
Overall change 522 B 522 B
Edge SSR bundle Size Overall increase ⚠️
vercel/next.js canary vercel/next.js 02-10-_devoverlay_enable_by_default Change
edge-ssr.js gzip 130 kB 130 kB N/A
page.js gzip 211 kB 215 kB ⚠️ +3.29 kB
Overall change 211 kB 215 kB ⚠️ +3.29 kB
Middleware size Overall increase ⚠️
vercel/next.js canary vercel/next.js 02-10-_devoverlay_enable_by_default Change
middleware-b..fest.js gzip 675 B 672 B N/A
middleware-r..fest.js gzip 155 B 156 B N/A
middleware.js gzip 31.4 kB 31.6 kB ⚠️ +242 B
edge-runtime..pack.js gzip 844 B 844 B
Overall change 32.2 kB 32.5 kB ⚠️ +242 B
Next Runtimes
vercel/next.js canary vercel/next.js 02-10-_devoverlay_enable_by_default Change
app-page-exp...dev.js gzip 395 kB 395 kB N/A
app-page-exp..prod.js gzip 133 kB 133 kB
app-page-tur..prod.js gzip 145 kB 145 kB
app-page-tur..prod.js gzip 141 kB 141 kB
app-page.run...dev.js gzip 382 kB 382 kB N/A
app-page.run..prod.js gzip 129 kB 129 kB
app-route-ex...dev.js gzip 39.4 kB 39.4 kB
app-route-ex..prod.js gzip 25.7 kB 25.7 kB
app-route-tu..prod.js gzip 25.7 kB 25.7 kB
app-route-tu..prod.js gzip 25.5 kB 25.5 kB
app-route.ru...dev.js gzip 41 kB 41 kB
app-route.ru..prod.js gzip 25.5 kB 25.5 kB
dist_client_...dev.js gzip 356 B 356 B
dist_client_...dev.js gzip 349 B 349 B
pages-api-tu..prod.js gzip 9.72 kB 9.72 kB
pages-api.ru...dev.js gzip 11.8 kB 11.8 kB
pages-api.ru..prod.js gzip 9.72 kB 9.72 kB
pages-turbo...prod.js gzip 22 kB 22 kB
pages.runtim...dev.js gzip 31.6 kB 31.6 kB
pages.runtim..prod.js gzip 22 kB 22 kB
server.runti..prod.js gzip 61.2 kB 61.2 kB
Overall change 900 kB 900 kB
build cache Overall increase ⚠️
vercel/next.js canary vercel/next.js 02-10-_devoverlay_enable_by_default Change
0.pack gzip 2.12 MB 2.12 MB ⚠️ +3.06 kB
index.pack gzip 75.7 kB 76.3 kB ⚠️ +648 B
Overall change 2.19 MB 2.2 MB ⚠️ +3.71 kB
Diff details
Diff for page.js

Diff too large to display

Diff for middleware.js

Diff too large to display

Diff for edge-ssr.js

Diff too large to display

Diff for 5306-HASH.js

Diff too large to display

Diff for bccd1874-HASH.js

Diff too large to display

Diff for main-HASH.js

Diff too large to display

Diff for app-page-exp..ntime.dev.js

Diff too large to display

Diff for app-page.runtime.dev.js

Diff too large to display

Commit: 799111c

@ztanner ztanner force-pushed the 02-10-_devoverlay_enable_by_default branch from 5f0354b to fc79403 Compare February 11, 2025 00:39
@ijjk ijjk added the tests label Feb 11, 2025
@ztanner ztanner force-pushed the 02-10-_devoverlay_enable_by_default branch 4 times, most recently from c226c9a to dc2cf7a Compare February 11, 2025 02:28
@ztanner ztanner force-pushed the 02-10-_devoverlay_enable_by_default branch 3 times, most recently from 4046ed8 to d308155 Compare February 11, 2025 19:40
@ztanner ztanner changed the base branch from canary to 02-11-_devoverlay_render_indicator_in_pages_router February 11, 2025 19:40
@ztanner ztanner force-pushed the 02-11-_devoverlay_render_indicator_in_pages_router branch 2 times, most recently from 11825dc to 3bb7b5e Compare February 11, 2025 20:48
@ztanner ztanner force-pushed the 02-10-_devoverlay_enable_by_default branch from d308155 to 1097c7f Compare February 11, 2025 20:48
@ztanner ztanner force-pushed the 02-11-_devoverlay_render_indicator_in_pages_router branch from 3bb7b5e to 895b418 Compare February 11, 2025 21:01
@ztanner ztanner force-pushed the 02-10-_devoverlay_enable_by_default branch from 1097c7f to ebdc078 Compare February 11, 2025 21:01
@ztanner ztanner changed the base branch from 02-11-_devoverlay_render_indicator_in_pages_router to graphite-base/75882 February 11, 2025 21:50
@ztanner ztanner force-pushed the graphite-base/75882 branch from 895b418 to 9ffd729 Compare February 11, 2025 21:50
@ztanner ztanner force-pushed the 02-10-_devoverlay_enable_by_default branch from ebdc078 to f09ef9d Compare February 11, 2025 21:50
Copy link
Member

@devjiwonchoi devjiwonchoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LFG 👏

@ztanner ztanner force-pushed the 02-10-_devoverlay_enable_by_default branch from 9382f8d to 8b808ec Compare February 13, 2025 15:42
5 | <div>

https://nextjs.org/docs/messages/module-not-found"
"./app/page.js (2:1)
Copy link
Member

@eps1lon eps1lon Feb 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

follow-up: Why are these in round brackets? This seems like a pretty exotic variation. File and line/column number are usually part of the location.

@ztanner ztanner force-pushed the 02-10-_devoverlay_enable_by_default branch 2 times, most recently from 49a3bea to 4e0b6cf Compare February 13, 2025 17:27
@ztanner ztanner force-pushed the 02-10-_devoverlay_enable_by_default branch from 4e0b6cf to 5f8a996 Compare February 13, 2025 17:28
@ztanner ztanner force-pushed the 02-10-_devoverlay_enable_by_default branch from 5f8a996 to 799111c Compare February 13, 2025 18:02
@ztanner ztanner merged commit 1c85b75 into canary Feb 13, 2025
123 of 128 checks passed
@ztanner ztanner deleted the 02-10-_devoverlay_enable_by_default branch February 13, 2025 18:57
devjiwonchoi added a commit that referenced this pull request Feb 13, 2025
The test failed since #75882 was
merged with a lot of test changes, but
#75768 didn't rebase.
lubieowoce added a commit that referenced this pull request Feb 17, 2025
### What
- Fixes an issue where `after()` in an edge page would not run if the
request was cancelled/aborted
- Unskips the `runs callbacks if redirect() was called` test which was
disabled to not block other things

### Background

This was initially hit in #75882, during which the `runs callbacks if
redirect() was called` test started failing when using experimental
react + turbo in dev mode. Turns out that this happenws because
something got slower and we weren't finishing the redirect response in
time, i.e. before the browser disconnected and started loading the page
it got redirected to.

It's relevant that the response didn't finish streaming, because in
`edge`, we use that as the trigger to start running `after()` callbacks.
In particular, we instrument the response stream using
`trackStreamConsumed`. The problem was that this function didn't handle
the stream being cancelled, which is what happens when a request is
aborted mid-streaming, so `after()` never ended up executing.

This PR fixes that and adds some tests for cancellation and interrupted
streaming.
lubieowoce added a commit that referenced this pull request Feb 17, 2025
- Fixes an issue where `after()` in an edge page would not run if the
request was cancelled/aborted
- Unskips the `runs callbacks if redirect() was called` test which was
disabled to not block other things

This was initially hit in #75882, during which the `runs callbacks if
redirect() was called` test started failing when using experimental
react + turbo in dev mode. Turns out that this happenws because
something got slower and we weren't finishing the redirect response in
time, i.e. before the browser disconnected and started loading the page
it got redirected to.

It's relevant that the response didn't finish streaming, because in
`edge`, we use that as the trigger to start running `after()` callbacks.
In particular, we instrument the response stream using
`trackStreamConsumed`. The problem was that this function didn't handle
the stream being cancelled, which is what happens when a request is
aborted mid-streaming, so `after()` never ended up executing.

This PR fixes that and adds some tests for cancellation and interrupted
streaming.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants