Skip to content

Conversation

@bgw
Copy link
Member

@bgw bgw commented Nov 29, 2025

It looks like we only do this for the edge runtime. This is bad because:

  • It's a lot of extra data to copy around and write out to disk.
  • It increases the chance of cache invalidation within Turbopack.
  • It means that Turbopack must understand how to serialize NextConfig, which means rustc needs to generate some pretty large functions. And Turbopack's NextConfig is pretty incomplete, so relying on that is risky.
  • It potentially means more invalidations for the reusable deployment outputs project.

Let's see what CI thinks of this change...

@ijjk ijjk added created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js. type: next labels Nov 29, 2025
Copy link
Member Author

bgw commented Nov 29, 2025

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

@bgw bgw marked this pull request as ready for review November 29, 2025 00:37
@bgw bgw marked this pull request as draft November 29, 2025 00:37
adjust_font_fallbacks_with_size_adjust: Option<bool>,
after: Option<bool>,
app_document_preloading: Option<bool>,
cache_life: Option<FxIndexMap<String, CacheLifeProfile>>,
Copy link
Member Author

Choose a reason for hiding this comment

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

An example of why this was a bad idea: This config was moved out of experimental, but Turbopack's config was never updated, so edge-app-route.ts​ was probably reading the wrong value when using Turbopack...

@ijjk
Copy link
Member

ijjk commented Nov 29, 2025

Failing test suites

Commit: e20fb2a | About building and testing Next.js

pnpm test test/integration/production-build-dir/test/index.test.ts (turbopack) (job)

  • Image Loader Config with Edge Runtime > production mode > should add "src" to img1 based on the loader config (DD)
  • Image Loader Config with Edge Runtime > production mode > should add "srcset" to img1 based on the loader config (DD)
  • Image Loader Config with Edge Runtime > production mode > should add "src" to img2 based on the loader prop (DD)
  • Image Loader Config with Edge Runtime > production mode > should add "srcset" to img2 based on the loader prop (DD)
Expand output

● Image Loader Config with Edge Runtime › production mode › should add "src" to img1 based on the loader config

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('#img1') to be visible

  519 |
  520 |     return this.startChain(async () => {
> 521 |       const el = await page.waitForSelector(selector, {
      |                             ^
  522 |         timeout,
  523 |         state,
  524 |       })

  at waitForSelector (lib/browsers/playwright.ts:521:29)
  at Playwright._chain (lib/browsers/playwright.ts:651:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:632:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:520:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:405:17)
  at Playwright.elementByCss [as elementById] (lib/browsers/playwright.ts:425:17)
  at Object.elementById (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:21:26)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:627:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:455:17)
  at Object.getAttribute (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:21:46)

● Image Loader Config with Edge Runtime › production mode › should add "srcset" to img1 based on the loader config

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('#img1') to be visible

  519 |
  520 |     return this.startChain(async () => {
> 521 |       const el = await page.waitForSelector(selector, {
      |                             ^
  522 |         timeout,
  523 |         state,
  524 |       })

  at waitForSelector (lib/browsers/playwright.ts:521:29)
  at Playwright._chain (lib/browsers/playwright.ts:651:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:632:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:520:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:405:17)
  at Playwright.elementByCss [as elementById] (lib/browsers/playwright.ts:425:17)
  at Object.elementById (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:27:26)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:627:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:455:17)
  at Object.getAttribute (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:27:46)

● Image Loader Config with Edge Runtime › production mode › should add "src" to img2 based on the loader prop

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('#img2') to be visible

  519 |
  520 |     return this.startChain(async () => {
> 521 |       const el = await page.waitForSelector(selector, {
      |                             ^
  522 |         timeout,
  523 |         state,
  524 |       })

  at waitForSelector (lib/browsers/playwright.ts:521:29)
  at Playwright._chain (lib/browsers/playwright.ts:651:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:632:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:520:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:405:17)
  at Playwright.elementByCss [as elementById] (lib/browsers/playwright.ts:425:17)
  at Object.elementById (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:33:26)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:627:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:455:17)
  at Object.getAttribute (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:33:46)

● Image Loader Config with Edge Runtime › production mode › should add "srcset" to img2 based on the loader prop

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('#img2') to be visible

  519 |
  520 |     return this.startChain(async () => {
> 521 |       const el = await page.waitForSelector(selector, {
      |                             ^
  522 |         timeout,
  523 |         state,
  524 |       })

  at waitForSelector (lib/browsers/playwright.ts:521:29)
  at Playwright._chain (lib/browsers/playwright.ts:651:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:632:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:520:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:405:17)
  at Playwright.elementByCss [as elementById] (lib/browsers/playwright.ts:425:17)
  at Object.elementById (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:39:26)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:627:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:455:17)
  at Object.getAttribute (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:39:46)

pnpm test test/integration/dist-dir/test/index.test.ts (turbopack) (job)

  • distDir > production mode > should handle undefined distDir (DD)
Expand output

● distDir › production mode › should handle undefined distDir

expect(received).toBeEmpty()

Expected value to be empty received:
  "[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
"

  107 |         await fs.writeFile(nextConfig, origNextConfig)
  108 |
> 109 |         expect(stderr).toBeEmpty()
      |                        ^
  110 |       })
  111 |     }
  112 |   )

  at Object.toBeEmpty (integration/dist-dir/test/index.test.ts:109:24)

pnpm test-start test/e2e/app-dir/cache-components-errors/cache-components-console-patch.test.ts (job)

  • Cache Components Errors > Sync IO in console methods > Console Patching > does not fail the build for Sync IO if console.log is patched to call new Date() internally (DD)
Expand output

● Cache Components Errors › Sync IO in console methods › Console Patching › does not fail the build for Sync IO if console.log is patched to call new Date() internally

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Sync IO in console methods Console Patching does not fail the build for Sync IO if console.log is patched to call new Date() internally 1`

- Snapshot  - 0
+ Received  + 4

+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
  [<timestamp>] This is a console log from a server component page
  [<timestamp>] This is a console log from a server component page
  [<timestamp>]   Collecting build traces ...
  [<timestamp>]

  68 |             `)
  69 |           } else {
> 70 |             expect(output).toMatchInlineSnapshot(`
     |                            ^
  71 |              "[<timestamp>] This is a console log from a server component page
  72 |              [<timestamp>] This is a console log from a server component page
  73 |              [<timestamp>]   Collecting build traces ...

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-console-patch.test.ts:70:28)

pnpm test test/integration/next-image-new/loader-config-edge-runtime/test/index.test.ts (turbopack) (job)

  • Image Loader Config with Edge Runtime > development mode > should add "src" to img1 based on the loader config (DD)
  • Image Loader Config with Edge Runtime > development mode > should add "srcset" to img1 based on the loader config (DD)
  • Image Loader Config with Edge Runtime > development mode > should add "src" to img2 based on the loader prop (DD)
  • Image Loader Config with Edge Runtime > development mode > should add "srcset" to img2 based on the loader prop (DD)
Expand output

● Image Loader Config with Edge Runtime › development mode › should add "src" to img1 based on the loader config

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('#img1') to be visible

  519 |
  520 |     return this.startChain(async () => {
> 521 |       const el = await page.waitForSelector(selector, {
      |                             ^
  522 |         timeout,
  523 |         state,
  524 |       })

  at waitForSelector (lib/browsers/playwright.ts:521:29)
  at Playwright._chain (lib/browsers/playwright.ts:651:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:632:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:520:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:405:17)
  at Playwright.elementByCss [as elementById] (lib/browsers/playwright.ts:425:17)
  at Object.elementById (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:21:26)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:627:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:455:17)
  at Object.getAttribute (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:21:46)

● Image Loader Config with Edge Runtime › development mode › should add "srcset" to img1 based on the loader config

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('#img1') to be visible

  519 |
  520 |     return this.startChain(async () => {
> 521 |       const el = await page.waitForSelector(selector, {
      |                             ^
  522 |         timeout,
  523 |         state,
  524 |       })

  at waitForSelector (lib/browsers/playwright.ts:521:29)
  at Playwright._chain (lib/browsers/playwright.ts:651:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:632:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:520:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:405:17)
  at Playwright.elementByCss [as elementById] (lib/browsers/playwright.ts:425:17)
  at Object.elementById (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:27:26)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:627:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:455:17)
  at Object.getAttribute (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:27:46)

● Image Loader Config with Edge Runtime › development mode › should add "src" to img2 based on the loader prop

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('#img2') to be visible

  519 |
  520 |     return this.startChain(async () => {
> 521 |       const el = await page.waitForSelector(selector, {
      |                             ^
  522 |         timeout,
  523 |         state,
  524 |       })

  at waitForSelector (lib/browsers/playwright.ts:521:29)
  at Playwright._chain (lib/browsers/playwright.ts:651:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:632:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:520:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:405:17)
  at Playwright.elementByCss [as elementById] (lib/browsers/playwright.ts:425:17)
  at Object.elementById (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:33:26)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:627:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:455:17)
  at Object.getAttribute (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:33:46)

● Image Loader Config with Edge Runtime › development mode › should add "srcset" to img2 based on the loader prop

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('#img2') to be visible

  519 |
  520 |     return this.startChain(async () => {
> 521 |       const el = await page.waitForSelector(selector, {
      |                             ^
  522 |         timeout,
  523 |         state,
  524 |       })

  at waitForSelector (lib/browsers/playwright.ts:521:29)
  at Playwright._chain (lib/browsers/playwright.ts:651:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:632:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:520:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:405:17)
  at Playwright.elementByCss [as elementById] (lib/browsers/playwright.ts:425:17)
  at Object.elementById (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:39:26)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:627:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:455:17)
  at Object.getAttribute (integration/next-image-new/loader-config-edge-runtime/test/index.test.ts:39:46)

pnpm test test/integration/webpack-require-hook/test/index.test.ts (job)

  • Handles Webpack Require Hook > build > Does not error during build (DD)
Expand output

● Handles Webpack Require Hook › build › Does not error during build

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

- Expected  - 1
+ Received  + 7

- Array []
+ Array [
+   "[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`",
+   "[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`",
+   "[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`",
+   "[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`",
+   "[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`",
+ ]

  26 |           .split('\n')
  27 |           .filter((line) => line && !line.trim().startsWith('⚠'))
> 28 |         expect(errors).toEqual([])
     |                        ^
  29 |         expect(stdout).toMatch(/Initialized config/)
  30 |       })
  31 |     })

  at Object.toEqual (integration/webpack-require-hook/test/index.test.ts:28:24)

pnpm test test/integration/config-output-export/test/index.test.ts (turbopack) (job)

  • config-output-export > should work with static homepage (DD)
  • config-output-export > should work with getStaticPaths and fallback false (DD)
Expand output

● config-output-export › should work with static homepage

expect(received).toBeEmpty()

Expected value to be empty received:
  "[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
"

  50 |       '<div id="__next">Hello World</div>'
  51 |     )
> 52 |     expect(result.stderr).toBeEmpty()
     |                           ^
  53 |   })
  54 |
  55 |   it('should error with "i18n" config', async () => {

  at Object.toBeEmpty (integration/config-output-export/test/index.test.ts:52:27)

● config-output-export › should work with getStaticPaths and fallback false

expect(received).toBeEmpty()

Expected value to be empty received:
  "[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
"

  445 |       expect(await h1.text()).toContain('Hello from one')
  446 |       await waitForNoRedbox(browser)
> 447 |       expect(result.stderr).toBeEmpty()
      |                             ^
  448 |     } finally {
  449 |       await killApp(app).catch(() => {})
  450 |       fs.rmSync(posts, { recursive: true, force: true })

  at Object.toBeEmpty (integration/config-output-export/test/index.test.ts:447:29)

pnpm test test/integration/cli/test/index.test.ts (turbopack) (job)

  • CLI Usage > dev > NODE_OPTIONS='--require=file with spaces to-require-with-node-require-option.js' (DD)
  • CLI Usage > dev > NODE_OPTIONS='--require=file with spaces to --require.js' (DD)
Expand output

● CLI Usage › dev › NODE_OPTIONS='--require=file with spaces to-require-with-node-require-option.js'

expect(received).toBe(expected) // Object.is equality

Expected: ""
Received: "[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
"

  702 |           'FILE_WITH_SPACES_TO_REQUIRE_WITH_NODE_REQUIRE_OPTION'
  703 |         )
> 704 |         expect(errOutput).toBe('')
      |                           ^
  705 |       } finally {
  706 |         await killApp(app)
  707 |       }

  at Object.toBe (integration/cli/test/index.test.ts:704:27)

● CLI Usage › dev › NODE_OPTIONS='--require=file with spaces to --require.js'

expect(received).toBe(expected) // Object.is equality

Expected: ""
Received: "[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
"

  734 |           'FILE_WITH_SPACES_TO_REQUIRE_WITH_NODE_REQUIRE_OPTION'
  735 |         )
> 736 |         expect(errOutput).toBe('')
      |                           ^
  737 |       } finally {
  738 |         await killApp(app)
  739 |       }

  at Object.toBe (integration/cli/test/index.test.ts:736:27)

pnpm test-dev-turbo test/e2e/app-dir/app-edge/app-edge.test.ts (turbopack) (job)

  • app-dir edge SSR > should handle edge only routes (DD)
Expand output

● app-dir edge SSR › should handle edge only routes

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

Expected substring: "<p>pages-edge-ssr</p>"
Received string:    "<!DOCTYPE html><html><head><meta charSet=\"utf-8\" data-next-head=\"\"/><meta name=\"viewport\" content=\"width=device-width\" data-next-head=\"\"/><style data-next-hide-fouc=\"true\">body{display:none}</style><noscript data-next-hide-fouc=\"true\"><style>body{display:block}</style></noscript><noscript data-n-css=\"\"></noscript><script defer=\"\" noModule=\"\" src=\"/_next/static/chunks/13417_next_dist_build_polyfills_polyfill-nomodule.js\"></script><script src=\"/_next/static/chunks/13417_next_dist_compiled_2ccc422a._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/13417_next_dist_shared_lib_bb7201d2._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/13417_next_dist_client_625d99dd._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/13417_next_dist_3faa5a62._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/13417_next_app_f6ea9152.js\" defer=\"\"></script><script src=\"/_next/static/chunks/%5Bnext%5D_entry_page-loader_ts_a02094f6._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/76102_react-dom_44795136._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/node_modules__pnpm_7136f466._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/%5Broot-of-the-server%5D__45f039c3._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__app_2da965e7._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/turbopack-pages__app_77b578b8._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/13417_next_dist_shared_lib_1eeb50a5._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/13417_next_dist_b152f960._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/13417_next_error_9f5a9d20.js\" defer=\"\"></script><script src=\"/_next/static/chunks/%5Bnext%5D_entry_page-loader_ts_2bf0b659._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/%5Broot-of-the-server%5D__092393de._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__error_2da965e7._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/turbopack-pages__error_f378f606._.js\" defer=\"\"></script><script src=\"/_next/static/development/_ssgManifest.js\" defer=\"\"></script><script src=\"/_next/static/development/_buildManifest.js\" defer=\"\"></script><noscript id=\"__next_css__DO_NOT_USE__\"></noscript></head><body><div id=\"__next\"></div><script id=\"__NEXT_DATA__\" type=\"application/json\">{\"props\":{\"pageProps\":{\"statusCode\":500,\"hostname\":\"localhost\"}},\"page\":\"/_error\",\"query\":{},\"buildId\":\"development\",\"isFallback\":false,\"err\":{\"name\":\"TypeError\",\"source\":\"edge-server\",\"message\":\"Cannot read properties of undefined (reading 'optimizeCss')\",\"stack\":\"TypeError: Cannot read properties of undefined (reading 'optimizeCss')\\n    at Object.requestHandler [as handler] (file:///tmp/next-install-3c1b224bb094ab6f0d11002769726933cf3c261c14ca6f970804793c7bedeff1/.next/dev/server/edge/chunks/ssr/_b579d20e._.js:17645:50)\\n    at async adapter (file:///tmp/next-install-3c1b224bb094ab6f0d11002769726933cf3c261c14ca6f970804793c7bedeff1/.next/dev/server/edge/chunks/ssr/_b579d20e._.js:5752:16)\\n    at at async /tmp/next-install-3c1b224bb094ab6f0d11002769726933cf3c261c14ca6f970804793c7bedeff1/node_modules/.pnpm/next (file+..+next-repo-bed896190eb3623b68c55911a323a16ec2c8e0b12ee3fe5f6222f500c158e283_c0a74cc767541cd1be08e8dbde652b21/node_modules/next/dist/server/web/sandbox/sandbox.js:112:26)\\n    at async runWithTaggedErrors (file:///tmp/next-install-3c1b224bb094ab6f0d11002769726933cf3c261c14ca6f970804793c7bedeff1/node_modules/.pnpm/next@file+..+next-repo-bed896190eb3623b68c55911a323a16ec2c8e0b12ee3fe5f6222f500c158e283_c0a74cc767541cd1be08e8dbde652b21/node_modules/next/dist/server/web/sandbox/sandbox.js:109:9)\\n    at async DevServer.runEdgeFunction (file:///tmp/next-install-3c1b224bb094ab6f0d11002769726933cf3c261c14ca6f970804793c7bedeff1/node_modules/.pnpm/next@file+..+next-repo-bed896190eb3623b68c55911a323a16ec2c8e0b12ee3fe5f6222f500c158e283_c0a74cc767541cd1be08e8dbde652b21/node_modules/next/dist/server/next-server.js:1354:24)\\n    at async NextNodeServer.handleCatchallRenderRequest (file:///tmp/next-install-3c1b224bb094ab6f0d11002769726933cf3c261c14ca6f970804793c7bedeff1/node_modules/.pnpm/next@file+..+next-repo-bed896190eb3623b68c55911a323a16ec2c8e0b12ee3fe5f6222f500c158e283_c0a74cc767541cd1be08e8dbde652b21/node_modules/next/dist/server/next-server.js:362:41)\\n    at async DevServer.handleRequestImpl (file:///tmp/next-install-3c1b224bb094ab6f0d11002769726933cf3c261c14ca6f970804793c7bedeff1/node_modules/.pnpm/next@file+..+next-repo-bed896190eb3623b68c55911a323a16ec2c8e0b12ee3fe5f6222f500c158e283_c0a74cc767541cd1be08e8dbde652b21/node_modules/next/dist/server/base-server.js:898:17)\\n    at at async /tmp/next-install-3c1b224bb094ab6f0d11002769726933cf3c261c14ca6f970804793c7bedeff1/node_modules/.pnpm/next (file+..+next-repo-bed896190eb3623b68c55911a323a16ec2c8e0b12ee3fe5f6222f500c158e283_c0a74cc767541cd1be08e8dbde652b21/node_modules/next/dist/server/dev/next-dev-server.js:386:20)\\n    at async Span.traceAsyncFn (file:///tmp/next-install-3c1b224bb094ab6f0d11002769726933cf3c261c14ca6f970804793c7bedeff1/node_modules/.pnpm/next@file+..+next-repo-bed896190eb3623b68c55911a323a16ec2c8e0b12ee3fe5f6222f500c158e283_c0a74cc767541cd1be08e8dbde652b21/node_modules/next/dist/trace/trace.js:157:20)\\n    at async DevServer.handleRequest (file:///tmp/next-install-3c1b224bb094ab6f0d11002769726933cf3c261c14ca6f970804793c7bedeff1/node_modules/.pnpm/next@file+..+next-repo-bed896190eb3623b68c55911a323a16ec2c8e0b12ee3fe5f6222f500c158e283_c0a74cc767541cd1be08e8dbde652b21/node_modules/next/dist/server/dev/next-dev-server.js:382:24)\"},\"gip\":true,\"scriptLoader\":[]}</script></body></html>"

  17 |
  18 |     const pageHtml = await next.render('/pages-edge')
> 19 |     expect(pageHtml).toContain('<p>pages-edge-ssr</p>')
     |                      ^
  20 |   })
  21 |
  22 |   it('should retrieve cookies in a server component in the edge runtime', async () => {

  at Object.toContain (e2e/app-dir/app-edge/app-edge.test.ts:19:22)

pnpm test-start-turbo test/e2e/app-dir/rsc-basic/rsc-basic.test.ts (turbopack) (job)

  • edge-render-getserversideprops > should have correct query/params on index (DD)
  • edge-render-getserversideprops > should have correct query/params on /[id] (DD)
  • edge-render-getserversideprops > should have correct query/params on rewrite (DD)
  • edge-render-getserversideprops > should have correct query/params on dynamic rewrite (DD)
  • edge-render-getserversideprops > should respond to _next/data for index correctly (DD)
  • edge-render-getserversideprops > should respond to _next/data for [id] correctly (DD)
Expand output

● edge-render-getserversideprops › should have correct query/params on index

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 500

  67 |   it('should have correct query/params on index', async () => {
  68 |     const res = await fetchViaHTTP(next.url, '/')
> 69 |     expect(res.status).toBe(200)
     |                        ^
  70 |     const html = await res.text()
  71 |     const $ = cheerio.load(html)
  72 |     expect($('#page').text()).toBe('/index')

  at Object.toBe (e2e/edge-pages-support/index.test.ts:69:24)

● edge-render-getserversideprops › should have correct query/params on /[id]

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 500

  79 |   it('should have correct query/params on /[id]', async () => {
  80 |     const res = await fetchViaHTTP(next.url, '/123', { hello: 'world' })
> 81 |     expect(res.status).toBe(200)
     |                        ^
  82 |     const html = await res.text()
  83 |     const $ = cheerio.load(html)
  84 |     expect($('#page').text()).toBe('/[id]')

  at Object.toBe (e2e/edge-pages-support/index.test.ts:81:24)

● edge-render-getserversideprops › should have correct query/params on rewrite

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 500

  93 |       hello: 'world',
  94 |     })
> 95 |     expect(res.status).toBe(200)
     |                        ^
  96 |     const html = await res.text()
  97 |     const $ = cheerio.load(html)
  98 |     expect($('#page').text()).toBe('/index')

  at Object.toBe (e2e/edge-pages-support/index.test.ts:95:24)

● edge-render-getserversideprops › should have correct query/params on dynamic rewrite

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 500

  107 |       hello: 'world',
  108 |     })
> 109 |     expect(res.status).toBe(200)
      |                        ^
  110 |     const html = await res.text()
  111 |     const $ = cheerio.load(html)
  112 |     expect($('#page').text()).toBe('/[id]')

  at Object.toBe (e2e/edge-pages-support/index.test.ts:109:24)

● edge-render-getserversideprops › should respond to _next/data for index correctly

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 500

  128 |       }
  129 |     )
> 130 |     expect(res.status).toBe(200)
      |                        ^
  131 |     const { pageProps: props } = await res.json()
  132 |     expect(props.query).toEqual({})
  133 |     expect(props.params).toBe(null)

  at Object.toBe (e2e/edge-pages-support/index.test.ts:130:24)

● edge-render-getserversideprops › should respond to _next/data for [id] correctly

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 500

  145 |       }
  146 |     )
> 147 |     expect(res.status).toBe(200)
      |                        ^
  148 |     const { pageProps: props } = await res.json()
  149 |     expect(props.query).toEqual({ id: '321', hello: 'world' })
  150 |     expect(props.params).toEqual({ id: '321' })

  at Object.toBe (e2e/edge-pages-support/index.test.ts:147:24)

pnpm test-dev-turbo test/e2e/edge-pages-support/index.test.ts (turbopack) (job)

  • edge-render-getserversideprops > should have correct query/params on index (DD)
  • edge-render-getserversideprops > should have correct query/params on /[id] (DD)
  • edge-render-getserversideprops > should have correct query/params on rewrite (DD)
  • edge-render-getserversideprops > should have correct query/params on dynamic rewrite (DD)
  • edge-render-getserversideprops > should respond to _next/data for index correctly (DD)
  • edge-render-getserversideprops > should respond to _next/data for [id] correctly (DD)
Expand output

● edge-render-getserversideprops › should have correct query/params on index

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 500

  67 |   it('should have correct query/params on index', async () => {
  68 |     const res = await fetchViaHTTP(next.url, '/')
> 69 |     expect(res.status).toBe(200)
     |                        ^
  70 |     const html = await res.text()
  71 |     const $ = cheerio.load(html)
  72 |     expect($('#page').text()).toBe('/index')

  at Object.toBe (e2e/edge-pages-support/index.test.ts:69:24)

● edge-render-getserversideprops › should have correct query/params on /[id]

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 500

  79 |   it('should have correct query/params on /[id]', async () => {
  80 |     const res = await fetchViaHTTP(next.url, '/123', { hello: 'world' })
> 81 |     expect(res.status).toBe(200)
     |                        ^
  82 |     const html = await res.text()
  83 |     const $ = cheerio.load(html)
  84 |     expect($('#page').text()).toBe('/[id]')

  at Object.toBe (e2e/edge-pages-support/index.test.ts:81:24)

● edge-render-getserversideprops › should have correct query/params on rewrite

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 500

  93 |       hello: 'world',
  94 |     })
> 95 |     expect(res.status).toBe(200)
     |                        ^
  96 |     const html = await res.text()
  97 |     const $ = cheerio.load(html)
  98 |     expect($('#page').text()).toBe('/index')

  at Object.toBe (e2e/edge-pages-support/index.test.ts:95:24)

● edge-render-getserversideprops › should have correct query/params on dynamic rewrite

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 500

  107 |       hello: 'world',
  108 |     })
> 109 |     expect(res.status).toBe(200)
      |                        ^
  110 |     const html = await res.text()
  111 |     const $ = cheerio.load(html)
  112 |     expect($('#page').text()).toBe('/[id]')

  at Object.toBe (e2e/edge-pages-support/index.test.ts:109:24)

● edge-render-getserversideprops › should respond to _next/data for index correctly

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 500

  128 |       }
  129 |     )
> 130 |     expect(res.status).toBe(200)
      |                        ^
  131 |     const { pageProps: props } = await res.json()
  132 |     expect(props.query).toEqual({})
  133 |     expect(props.params).toBe(null)

  at Object.toBe (e2e/edge-pages-support/index.test.ts:130:24)

● edge-render-getserversideprops › should respond to _next/data for [id] correctly

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 500

  145 |       }
  146 |     )
> 147 |     expect(res.status).toBe(200)
      |                        ^
  148 |     const { pageProps: props } = await res.json()
  149 |     expect(props.query).toEqual({ id: '321', hello: 'world' })
  150 |     expect(props.params).toEqual({ id: '321' })

  at Object.toBe (e2e/edge-pages-support/index.test.ts:147:24)

pnpm test-start-turbo test/e2e/edge-pages-support/edge-document.test.ts (turbopack) (job)

  • edge render - custom _document with edge runtime > should render page properly (DD)
Expand output

● edge render - custom _document with edge runtime › should render page properly

expect(received).toBe(expected) // Object.is equality

Expected: "/index"
Received: ""

  35 |   it('should render page properly', async () => {
  36 |     const $ = await next.render$('/')
> 37 |     expect($('#page').text()).toBe('/index')
     |                               ^
  38 |   })
  39 | })
  40 |

  at Object.toBe (e2e/edge-pages-support/edge-document.test.ts:37:31)

pnpm test-start-turbo test/production/dynamic-css-client-navigation/react-lazy.test.ts (turbopack) (job)

  • dynamic-css-client-navigation react lazy edge > should not remove style when navigating from static imported component to react lazy at runtime edge (DD)
Expand output

● dynamic-css-client-navigation react lazy edge › should not remove style when navigating from static imported component to react lazy at runtime edge

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('a[href="/edge/react-lazy"]') to be visible

  519 |
  520 |     return this.startChain(async () => {
> 521 |       const el = await page.waitForSelector(selector, {
      |                             ^
  522 |         timeout,
  523 |         state,
  524 |       })

  at waitForSelector (lib/browsers/playwright.ts:521:29)
  at Playwright._chain (lib/browsers/playwright.ts:651:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:632:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:520:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:405:17)
  at Object.elementByCss (production/dynamic-css-client-navigation/react-lazy.test.ts:14:12)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:627:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:471:17)
  at Object.click (production/dynamic-css-client-navigation/react-lazy.test.ts:15:12)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:632:17)
  at Proxy.startChain (lib/browsers/playwright.ts:520:17)
  at Object.waitForElementByCss (production/dynamic-css-client-navigation/react-lazy.test.ts:16:12)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:627:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:433:17)
  at Object.text (production/dynamic-css-client-navigation/react-lazy.test.ts:17:12)

pnpm test-dev-turbo test/e2e/import-conditions/import-conditions.test.ts (turbopack) (job)

  • react version > Pages Router page with edge runtime (DD)
Expand output

● react version › Pages Router page with edge runtime

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('output') to be visible

  519 |
  520 |     return this.startChain(async () => {
> 521 |       const el = await page.waitForSelector(selector, {
      |                             ^
  522 |         timeout,
  523 |         state,
  524 |       })

  at waitForSelector (lib/browsers/playwright.ts:521:29)
  at Playwright._chain (lib/browsers/playwright.ts:651:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:632:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:520:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:405:17)
  at Object.elementByCss (e2e/import-conditions/import-conditions.test.ts:40:32)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:627:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:433:17)
  at Object.text (e2e/import-conditions/import-conditions.test.ts:40:55)

pnpm test-start-turbo test/e2e/edge-runtime-uses-edge-light-import-specifier-for-packages/edge-runtime-uses-edge-light-import-specifier-for-packages.test.ts (turbopack) (job)

  • on-request-error - basic > pages router > should catch pages router page error in edge runtime (DD)
Expand output

● on-request-error - basic › pages router › should catch pages router page error in edge runtime

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

Expected: ArrayContaining [StringContaining "pages-page-edge-error"]
Received: ["[instrumentation] write-log:server-page-node-error", "[instrumentation] write-log:server-page-edge-error", "[instrumentation] write-log:client-page-node-error", "[instrumentation] write-log:client-page-edge-error", "[instrumentation] write-log:route-node-error", "[instrumentation] write-log:route-edge-error", "[instrumentation] write-log:pages-page-node-error", "[instrumentation] write-log:Cannot read properties of undefined (reading 'optimizeCss')"]

  29 |         .split('\n')
  30 |         .filter((log) => log.includes('[instrumentation] write-log'))
> 31 |       expect(recordLogLines).toEqual(
     |                              ^
  32 |         expect.arrayContaining([expect.stringContaining(errorMessage)])
  33 |       )
  34 |       // TODO: remove custom duration in case we increase the default.

  at toEqual (e2e/on-request-error/basic/basic.test.ts:31:30)
  at fn (lib/next-test-utils.ts:797:20)
  at validateErrorRecord (e2e/on-request-error/basic/basic.test.ts:27:5)
  at Object.<anonymous> (e2e/on-request-error/basic/basic.test.ts:128:7)

pnpm test-start test/production/app-dir/build-output-prerender/build-output-prerender.test.ts (job)

  • build-output-prerender > with a next config file > with --debug-prerender > prints a warning and the customized experimental flags (DD)
  • build-output-prerender > with a next config file > with --debug-prerender > shows all prerender errors with readable stacks and code frames (DD)
  • build-output-prerender > with a next config file > without --debug-prerender > prints only the user-selected experimental flags (and the ones enabled via env variable) (DD)
  • build-output-prerender > with a next config file > without --debug-prerender > shows only a single prerender error with a mangled stack (DD)
  • build-output-prerender > without a next config file > with --debug-prerender > prints a warning and the customized experimental flags (DD)
  • build-output-prerender > without a next config file > without --debug-prerender > prints no experimental flags (unless enabled via env variable) (DD)
Expand output

● build-output-prerender › with a next config file › without --debug-prerender › prints only the user-selected experimental flags (and the ones enabled via env variable)

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `build-output-prerender with a next config file without --debug-prerender prints only the user-selected experimental flags (and the ones enabled via env variable) 1`

- Snapshot  - 0
+ Received  + 1

+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
  ▲ Next.js x.y.z (webpack, Cache Components)
  - Experiments (use with caution):
    ✓ reactDebugChannel (enabled by `__NEXT_EXPERIMENTAL_DEBUG_CHANNEL`)

  26 |             `)
  27 |           } else {
> 28 |             expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
     |                                                       ^
  29 |              "▲ Next.js x.y.z (webpack, Cache Components)
  30 |              - Experiments (use with caution):
  31 |                ✓ reactDebugChannel (enabled by \`__NEXT_EXPERIMENTAL_DEBUG_CHANNEL\`)"

  at Object.toMatchInlineSnapshot (production/app-dir/build-output-prerender/build-output-prerender.test.ts:28:55)

● build-output-prerender › with a next config file › without --debug-prerender › shows only a single prerender error with a mangled stack

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `build-output-prerender with a next config file without --debug-prerender shows only a single prerender error with a mangled stack 1`

- Snapshot  - 1
+ Received  + 6

@@ -1,6 +1,11 @@
- "Error: Route "/client" used `new Date()` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
+ "[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
+ Error: Route "/client" used `new Date()` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
      at x (<next-dist-dir>)
  To get a more detailed stack trace and pinpoint the issue, try one of the following:
    - Start the app in development mode by running `next dev`, then open "/client" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/client". Read more: https://nextjs.org/docs/messages/prerender-error

  82 |           `)
  83 |         } else {
> 84 |           expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(`
     |                                                      ^
  85 |            "Error: Route "/client" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
  86 |                at x (<next-dist-dir>)
  87 |            To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (production/app-dir/build-output-prerender/build-output-prerender.test.ts:84:54)

● build-output-prerender › with a next config file › with --debug-prerender › prints a warning and the customized experimental flags

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `build-output-prerender with a next config file with --debug-prerender prints a warning and the customized experimental flags 1`

- Snapshot  - 0
+ Received  + 1

@@ -1,5 +1,6 @@
+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
  ⚠ Prerendering is running in debug mode. Note: This may affect performance and should not be used for production.
  ▲ Next.js x.y.z (webpack, Cache Components)
  - Experiments (use with caution):
    ⨯ prerenderEarlyExit (disabled by `--debug-prerender`)
    ✓ reactDebugChannel (enabled by `__NEXT_EXPERIMENTAL_DEBUG_CHANNEL`)

  117 |             `)
  118 |           } else {
> 119 |             expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
      |                                                       ^
  120 |              "⚠ Prerendering is running in debug mode. Note: This may affect performance and should not be used for production.
  121 |              ▲ Next.js x.y.z (webpack, Cache Components)
  122 |              - Experiments (use with caution):

  at Object.toMatchInlineSnapshot (production/app-dir/build-output-prerender/build-output-prerender.test.ts:119:55)

● build-output-prerender › with a next config file › with --debug-prerender › shows all prerender errors with readable stacks and code frames

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `build-output-prerender with a next config file with --debug-prerender shows all prerender errors with readable stacks and code frames 1`

- Snapshot  - 1
+ Received  + 6

@@ -1,6 +1,11 @@
- "Error: Route "/client" used `new Date()` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
+ "[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
+ Error: Route "/client" used `new Date()` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client

  at Page (../webpack:/app/client/page.tsx:4:28)
      2 |
      3 | export default function Page() {
    > 4 |   return <p>Current time: {new Date().toISOString()}</p>
        |                            ^
  at Object.toMatchInlineSnapshot (production/app-dir/build-output-prerender/build-output-prerender.test.ts:213:54)

● build-output-prerender › without a next config file › without --debug-prerender › prints no experimental flags (unless enabled via env variable)

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `build-output-prerender without a next config file without --debug-prerender prints no experimental flags (unless enabled via env variable) 1`

- Snapshot  - 0
+ Received  + 1

+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
  ▲ Next.js x.y.z (webpack, Cache Components)
  - Experiments (use with caution):
    ✓ reactDebugChannel (enabled by `__NEXT_EXPERIMENTAL_DEBUG_CHANNEL`)

  260 |             `)
  261 |           } else {
> 262 |             expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
      |                                                       ^
  263 |              "▲ Next.js x.y.z (webpack, Cache Components)
  264 |              - Experiments (use with caution):
  265 |                ✓ reactDebugChannel (enabled by \`__NEXT_EXPERIMENTAL_DEBUG_CHANNEL\`)"

  at Object.toMatchInlineSnapshot (production/app-dir/build-output-prerender/build-output-prerender.test.ts:262:55)

● build-output-prerender › without a next config file › with --debug-prerender › prints a warning and the customized experimental flags

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `build-output-prerender without a next config file with --debug-prerender prints a warning and the customized experimental flags 1`

- Snapshot  - 0
+ Received  + 1

@@ -1,5 +1,6 @@
+ [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
  ⚠ Prerendering is running in debug mode. Note: This may affect performance and should not be used for production.
  ▲ Next.js x.y.z (webpack, Cache Components)
  - Experiments (use with caution):
    ⨯ prerenderEarlyExit (disabled by `--debug-prerender`)
    ✓ reactDebugChannel (enabled by `__NEXT_EXPERIMENTAL_DEBUG_CHANNEL`)

  320 |             `)
  321 |           } else {
> 322 |             expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
      |                                                       ^
  323 |              "⚠ Prerendering is running in debug mode. Note: This may affect performance and should not be used for production.
  324 |              ▲ Next.js x.y.z (webpack, Cache Components)
  325 |              - Experiments (use with caution):

  at Object.toMatchInlineSnapshot (production/app-dir/build-output-prerender/build-output-prerender.test.ts:322:55)

pnpm test-start-turbo test/e2e/switchable-runtime/index.test.ts (turbopack) (job)

  • Instrumentation Hook > with-async-edge-page > with-async-edge-page should run the instrumentation hook (DD)
Expand output

● Instrumentation Hook › with-async-edge-page › with-async-edge-page should run the instrumentation hook

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

Expected substring: "Edge - finished: true"
Received string:    "<!DOCTYPE html><html><head><meta charSet=\"utf-8\" data-next-head=\"\"/><meta name=\"viewport\" content=\"width=device-width\" data-next-head=\"\"/><title data-next-head=\"\">500: Internal Server Error</title><noscript data-n-css=\"\"></noscript><script src=\"/_next/static/chunks/8fce9ab87a27a80a.js\" defer=\"\"></script><script src=\"/_next/static/chunks/072f6ce22a0421d0.js\" defer=\"\"></script><script src=\"/_next/static/chunks/turbopack-2f72fb25f289a3dd.js\" defer=\"\"></script><script src=\"/_next/static/chunks/c022ca80249aad03.js\" defer=\"\"></script><script src=\"/_next/static/chunks/turbopack-0c306198c0f057bf.js\" defer=\"\"></script><script src=\"/_next/static/zBVdkuG14eWuYV70ToUMd/_ssgManifest.js\" defer=\"\"></script><script src=\"/_next/static/zBVdkuG14eWuYV70ToUMd/_buildManifest.js\" defer=\"\"></script></head><body><div id=\"__next\"><div style=\"font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center\"><div style=\"line-height:48px\"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class=\"next-error-h1\" style=\"display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top\">500</h1><div style=\"display:inline-block\"><h2 style=\"font-size:14px;font-weight:400;line-height:28px\">Internal Server Error<!-- -->.</h2></div></div></div></div><script id=\"__NEXT_DATA__\" type=\"application/json\">{\"props\":{\"pageProps\":{\"statusCode\":500,\"hostname\":\"localhost\"}},\"page\":\"/_error\",\"query\":{},\"buildId\":\"zBVdkuG14eWuYV70ToUMd\",\"isFallback\":false,\"isExperimentalCompile\":false,\"err\":{\"name\":\"Internal Server Error.\",\"message\":\"500 - Internal Server Error.\",\"statusCode\":500},\"gip\":true,\"scriptLoader\":[]}</script></body></html>"

  71 |     it('with-async-edge-page should run the instrumentation hook', async () => {
  72 |       const page = await next.render('/')
> 73 |       expect(page).toContain('Edge - finished: true')
     |                    ^
  74 |     })
  75 |   })
  76 |

  at Object.toContain (e2e/instrumentation-hook/instrumentation-hook.test.ts:73:20)

pnpm test-dev-turbo test/e2e/instrumentation-hook/instrumentation-hook.test.ts (turbopack) (job)

  • Handle new URL asset references > pages router > should render the /pages-edge/static page (DD)
  • Handle new URL asset references > pages router > should client-render the /pages-edge/static page (DD)
  • Handle new URL asset references > pages router > should render the /pages-edge/ssr page (DD)
  • Handle new URL asset references > pages router > should client-render the /pages-edge/ssr page (DD)
Expand output

● Handle new URL asset references › pages router › should render the /pages-edge/static page

expect(received).toMatch(expected)

Expected pattern: /^Hello \/_next\/static\/media\/vercel\.[0-9a-f]{8}\.png(\+\/_next\/static\/media\/vercel\.[0-9a-f]{8}\.png(\+\/_next\/static\/media\/vercel\.[0-9a-f]{8}\.png)?)?$/
Received string:  ""

  143 |           const $ = await next.render$(page)
  144 |           // eslint-disable-next-line jest/no-standalone-expect
> 145 |           expect($('main').text()).toMatch(expectedPage)
      |                                    ^
  146 |         }
  147 |       )
  148 |       ;(shouldSkip ? it.skip : it)(

  at Object.toMatch (e2e/url/url.test.ts:145:36)

● Handle new URL asset references › pages router › should client-render the /pages-edge/static page

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('main') to be visible

  519 |
  520 |     return this.startChain(async () => {
> 521 |       const el = await page.waitForSelector(selector, {
      |                             ^
  522 |         timeout,
  523 |         state,
  524 |       })

  at waitForSelector (lib/browsers/playwright.ts:521:29)
  at Playwright._chain (lib/browsers/playwright.ts:651:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:632:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:520:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:405:17)
  at elementByCss (e2e/url/url.test.ts:153:34)
  at fn (lib/next-test-utils.ts:797:20)
  at Object.<anonymous> (e2e/url/url.test.ts:152:11)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:627:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:433:17)
  at text (e2e/url/url.test.ts:153:55)
  at fn (lib/next-test-utils.ts:797:20)
  at Object.<anonymous> (e2e/url/url.test.ts:152:11)

● Handle new URL asset references › pages router › should render the /pages-edge/ssr page

expect(received).toMatch(expected)

Expected pattern: /^Hello \/_next\/static\/media\/vercel\.[0-9a-f]{8}\.png(\+\/_next\/static\/media\/vercel\.[0-9a-f]{8}\.png(\+\/_next\/static\/media\/vercel\.[0-9a-f]{8}\.png)?)?$/
Received string:  ""

  143 |           const $ = await next.render$(page)
  144 |           // eslint-disable-next-line jest/no-standalone-expect
> 145 |           expect($('main').text()).toMatch(expectedPage)
      |                                    ^
  146 |         }
  147 |       )
  148 |       ;(shouldSkip ? it.skip : it)(

  at Object.toMatch (e2e/url/url.test.ts:145:36)

● Handle new URL asset references › pages router › should client-render the /pages-edge/ssr page

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('main') to be visible

  519 |
  520 |     return this.startChain(async () => {
> 521 |       const el = await page.waitForSelector(selector, {
      |                             ^
  522 |         timeout,
  523 |         state,
  524 |       })

  at waitForSelector (lib/browsers/playwright.ts:521:29)
  at Playwright._chain (lib/browsers/playwright.ts:651:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:632:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:520:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:405:17)
  at elementByCss (e2e/url/url.test.ts:153:34)
  at fn (lib/next-test-utils.ts:797:20)
  at Object.<anonymous> (e2e/url/url.test.ts:152:11)
  at Proxy._chain (lib/browsers/playwright.ts:651:23)
  at Proxy._chain (lib/browsers/playwright.ts:627:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:433:17)
  at text (e2e/url/url.test.ts:153:55)
  at fn (lib/next-test-utils.ts:797:20)
  at Object.<anonymous> (e2e/url/url.test.ts:152:11)

pnpm test packages/next-codemod/transforms/__tests__/add-missing-react-import.test.js (job)

  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-01 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-02 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-03 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-04 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-05 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-06 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-07 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-08 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-10 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-11 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-12 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-13 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-14 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-15 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-16 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-17 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-18 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-19 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-21 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-22 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-23 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-24 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-25 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-type-cast-01 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/async-api-type-cast-02 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/custom-routes-access-api-prop-01 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/generate-metadata-access-api-prop-01 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/generate-metadata-access-api-prop-02 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/generate-metadata-access-api-prop-03 (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/origin-name-01-util (DD)
  • next-async-request-api - dynamic-apis > transforms correctly next-async-request-api-dynamic-apis/origin-name-02-util (DD)
Expand output

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-01

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

- Expected  - 9
+ Received  + 9

- import { cookies } from 'next/headers'
-
+ import { cookies } from 'next/headers'
+ 
- export async function MyComponent() {
+ export async function MyComponent() {
-   const name = (await cookies()).get('name')
+   const name = (await cookies()).get('name')
-   callback(name)
+   callback(name)
- }
-
+ }
+ 
- function callback(name: any) {
+ function callback(name: any) {
-   console.log(name)
+   console.log(name)
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-02

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

- Expected  - 4
+ Received  + 4

- import { draftMode } from 'next/headers'
-
+ import { draftMode } from 'next/headers'
+ 
- export async function MyComponent() {
+ export async function MyComponent() {
-   (await draftMode()).enable()
+   (await draftMode()).enable()
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-03

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

- Expected  - 5
+ Received  + 5

- // If it's sync default export, convert to async and await the function call
+ // If it's sync default export, convert to async and await the function call
- import { draftMode } from 'next/headers'
-
+ import { draftMode } from 'next/headers'
+ 
- export default async function MyComponent() {
+ export default async function MyComponent() {
-   (await draftMode()).enable()
+   (await draftMode()).enable()
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-04

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

- Expected  - 8
+ Received  + 8

- import { draftMode } from 'next/headers'
-
+ import { draftMode } from 'next/headers'
+ 
- export default async function MyComponent() {
+ export default async function MyComponent() {
-   (await draftMode()).enable()
+   (await draftMode()).enable()
- }
-
+ }
+ 
- export async function MyComponent2() {
+ export async function MyComponent2() {
-   (await draftMode()).enable()
+   (await draftMode()).enable()
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-05

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

- Expected  - 9
+ Received  + 9

- import { use } from "react";
+ import { use } from "react";
- import { draftMode, type UnsafeUnwrappedDraftMode } from 'next/headers';
-
+ import { draftMode, type UnsafeUnwrappedDraftMode } from 'next/headers';
+ 
- export function MyComponent2() {
+ export function MyComponent2() {
-   (draftMode() as unknown as UnsafeUnwrappedDraftMode).enable()
+   (draftMode() as unknown as UnsafeUnwrappedDraftMode).enable()
- }
-
+ }
+ 
- export function useDraftModeEnabled() {
+ export function useDraftModeEnabled() {
-   use(draftMode()).enable()
+   use(draftMode()).enable()
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-06

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

- Expected  - 5
+ Received  + 5

- import React from 'react'
+ import React from 'react'
- import { draftMode } from 'next/headers'
-
+ import { draftMode } from 'next/headers'
+ 
- export default async function Page() {
+ export default async function Page() {
-   return <button disabled={(await draftMode()).isEnabled}>Enable Draft Mode</button>;
+   return <button disabled={(await draftMode()).isEnabled}>Enable Draft Mode</button>;
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-07

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

- Expected  - 5
+ Received  + 5

- // Already imported the type
+ // Already imported the type
- import { draftMode, type UnsafeUnwrappedDraftMode } from 'next/headers'
-
+ import { draftMode, type UnsafeUnwrappedDraftMode } from 'next/headers'
+ 
- export function MyComponent2() {
+ export function MyComponent2() {
-   (draftMode() as unknown as UnsafeUnwrappedDraftMode).enable()
+   (draftMode() as unknown as UnsafeUnwrappedDraftMode).enable()
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-08

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

- Expected  - 4
+ Received  + 4

- import { headers } from 'next/headers'
-
+ import { headers } from 'next/headers'
+ 
- export async function GET(): Promise<Response> {
+ export async function GET(): Promise<Response> {
-   await headers()
+   await headers()
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-10

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

- Expected  - 12
+ Received  + 12

- import { headers, type UnsafeUnwrappedHeaders } from 'next/headers';
-
+ import { headers, type UnsafeUnwrappedHeaders } from 'next/headers';
+ 
- export function MyComp() {
+ export function MyComp() {
-   return (headers() as unknown as UnsafeUnwrappedHeaders);
+   return (headers() as unknown as UnsafeUnwrappedHeaders);
- }
-
+ }
+ 
- export function MyComp2() {
+ export function MyComp2() {
-   return (headers() as unknown as UnsafeUnwrappedHeaders);
+   return (headers() as unknown as UnsafeUnwrappedHeaders);
- }
-
+ }
+ 
- export function MyComp3() {
+ export function MyComp3() {
-   return (headers() as unknown as UnsafeUnwrappedHeaders);
+   return (headers() as unknown as UnsafeUnwrappedHeaders);
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-11

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

- Expected  - 8
+ Received  + 8

- import { headers, type UnsafeUnwrappedHeaders } from 'next/headers';
-
+ import { headers, type UnsafeUnwrappedHeaders } from 'next/headers';
+ 
- export function MyComp() {
+ export function MyComp() {
-   void (headers() as unknown as UnsafeUnwrappedHeaders)
+   void (headers() as unknown as UnsafeUnwrappedHeaders)
- }
-
+ }
+ 
- export function generateContentfulMetadata() {
+ export function generateContentfulMetadata() {
-   void (headers() as unknown as UnsafeUnwrappedHeaders)
+   void (headers() as unknown as UnsafeUnwrappedHeaders)
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-12

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

- Expected  - 4
+ Received  + 4

- import { cookies } from "next/headers";
-
+ import { cookies } from "next/headers";
+ 
- async function MyComponent() {
+ async function MyComponent() {
-   callSomething(await cookies());
+   callSomething(await cookies());
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-13

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

- Expected  - 4
+ Received  + 4

- import { headers } from "next/headers";
-
+ import { headers } from "next/headers";
+ 
- async function MyComponent() {
+ async function MyComponent() {
-   callSomething(await headers());
+   callSomething(await headers());
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-14

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

- Expected  - 4
+ Received  + 4

- import { cookies } from "next/headers";
-
+ import { cookies } from "next/headers";
+ 
- export default async function Page() {
+ export default async function Page() {
-   callSomething(await cookies());
+   callSomething(await cookies());
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-15

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

- Expected  - 7
+ Received  + 7

- import { cookies } from "next/headers";
-
+ import { cookies } from "next/headers";
+ 
- async function MyComponent() {
+ async function MyComponent() {
-   function asyncFunction() {
+   function asyncFunction() {
-     callSomething(/* @next-codemod-error Manually await this call and refactor the function to be async */
+     callSomething(/* @next-codemod-error Manually await this call and refactor the function to be async */
-     cookies());
+     cookies());
-   }
+   }
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-16

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

- Expected  - 5
+ Received  + 5

- import { cookies } from "next/headers";
-
+ import { cookies } from "next/headers";
+ 
- function MyComponent() {
+ function MyComponent() {
-   callSomething(/* @next-codemod-error Manually await this call and refactor the function to be async */
+   callSomething(/* @next-codemod-error Manually await this call and refactor the function to be async */
-   cookies());
+   cookies());
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-17

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

- Expected  - 4
+ Received  + 4

- import { cookies } from 'next/headers'
-
+ import { cookies } from 'next/headers'
+ 
- export const myFun = async (): Promise<any> => {
+ export const myFun = async (): Promise<any> => {
-   const name = (await cookies()).get('name')
+   const name = (await cookies()).get('name')
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-18

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

- Expected  - 16
+ Received  + 16

- import {
+ import {
-   cookies as myCookies,
+   cookies as myCookies,
-   headers as myHeaders,
+   headers as myHeaders,
-   draftMode as myDraftMode,
+   draftMode as myDraftMode,
- } from 'next/headers'
-
+ } from 'next/headers'
+ 
- export const myFun = async (): Promise<any> => {
+ export const myFun = async (): Promise<any> => {
-   const name = (await myCookies()).get('name')
+   const name = (await myCookies()).get('name')
- }
-
+ }
+ 
- export const myFun2 = async (): Promise<any> => {
+ export const myFun2 = async (): Promise<any> => {
-   await myHeaders()
+   await myHeaders()
- }
-
+ }
+ 
- export const myFun3 = async (): Promise<any> => {
+ export const myFun3 = async (): Promise<any> => {
-   await myDraftMode()
+   await myDraftMode()
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-19

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

- Expected  - 12
+ Received  + 12

- import { cookies, headers, type UnsafeUnwrappedHeaders } from 'next/headers';
-
+ import { cookies, headers, type UnsafeUnwrappedHeaders } from 'next/headers';
+ 
- export function myFun() {
+ export function myFun() {
-   return async function () {
+   return async function () {
-     (await cookies()).get('name')
+     (await cookies()).get('name')
-   };
+   };
- }
-
+ }
+ 
- export function myFun2() {
+ export function myFun2() {
-   return function () {
+   return function () {
-     void (headers() as unknown as UnsafeUnwrappedHeaders)
+     void (headers() as unknown as UnsafeUnwrappedHeaders)
-   };
+   };
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-21

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

- Expected  - 7
+ Received  + 7

- const nextHeaders = /* @next-codemod-error The APIs under 'next/headers' are async now, need to be manually awaited. */
+ const nextHeaders = /* @next-codemod-error The APIs under 'next/headers' are async now, need to be manually awaited. */
- import('next/headers')
-
+ import('next/headers')
+ 
- function myFunc() {
+ function myFunc() {
-   nextHeaders.cookies()
+   nextHeaders.cookies()
- }
-
+ }
+ 
  const nextHeaders2 = /* @next-codemod-error The APIs under 'next/headers' are async now, need to be manually awaited. */ import('next/headers')

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-22

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

- Expected  - 10
+ Received  + 10

- import { cookies } from 'next/headers'
-
+ import { cookies } from 'next/headers'
+ 
- export const GET = async function() {
+ export const GET = async function() {
-   (await cookies()).get('token')
+   (await cookies()).get('token')
- }
-
+ }
+ 
- export async function POST(req: Request) {
+ export async function POST(req: Request) {
-   if (req.method === 'POST') {
+   if (req.method === 'POST') {
-     (await cookies()).get('token')
+     (await cookies()).get('token')
-   }
+   }
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-23

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

- Expected  - 5
+ Received  + 5

- import { cookies } from 'next/headers'
-
+ import { cookies } from 'next/headers'
+ 
- export type Cookie = Awaited<ReturnType<typeof cookies>>
+ export type Cookie = Awaited<ReturnType<typeof cookies>>
- export function foo(c: Awaited<ReturnType<typeof cookies>>) {
+ export function foo(c: Awaited<ReturnType<typeof cookies>>) {
-   return c
+   return c
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-24

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

- Expected  - 12
+ Received  + 12

- import { use } from "react";
+ import { use } from "react";
- import { cookies } from 'next/headers'
-
+ import { cookies } from 'next/headers'
+ 
- function useHook() {}
-
+ function useHook() {}
+ 
- export default function Page() {
+ export default function Page() {
-   useHook()
+   useHook()
-   const c = use(cookies());
+   const c = use(cookies());
- }
-
+ }
+ 
- export async function generateMetadata() {
+ export async function generateMetadata() {
-   await cookies()
+   await cookies()
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-25

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

- Expected  - 5
+ Received  + 5

- import { cookies, type UnsafeUnwrappedCookies } from 'next/headers';
-
+ import { cookies, type UnsafeUnwrappedCookies } from 'next/headers';
+ 
- export function myFunc() {
+ export function myFunc() {
-   const c = (cookies() as unknown as UnsafeUnwrappedCookies)
+   const c = (cookies() as unknown as UnsafeUnwrappedCookies)
-   void (cookies() as unknown as UnsafeUnwrappedCookies)
+   void (cookies() as unknown as UnsafeUnwrappedCookies)
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-type-cast-01

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

- Expected  - 26
+ Received  + 26

- import React from 'react'
+ import React from 'react'
- import {
+ import {
-   headers,
+   headers,
-   cookies,
+   cookies,
-   draftMode,
+   draftMode,
-   type UnsafeUnwrappedHeaders,
+   type UnsafeUnwrappedHeaders,
-   type UnsafeUnwrappedCookies,
+   type UnsafeUnwrappedCookies,
-   type UnsafeUnwrappedDraftMode,
+   type UnsafeUnwrappedDraftMode,
- } from 'next/headers';
-
+ } from 'next/headers';
+ 
- export function MyDraftComponent() {
+ export function MyDraftComponent() {
-   if ((draftMode() as unknown as UnsafeUnwrappedDraftMode).isEnabled) {
+   if ((draftMode() as unknown as UnsafeUnwrappedDraftMode).isEnabled) {
-     return null
+     return null
-   }
-
+   }
+ 
-   return <p>page</p>
+   return <p>page</p>
- }
-
+ }
+ 
- export function MyCookiesComponent() {
+ export function MyCookiesComponent() {
-   const c = (cookies() as unknown as UnsafeUnwrappedCookies)
+   const c = (cookies() as unknown as UnsafeUnwrappedCookies)
-   return c.get('name')
+   return c.get('name')
- }
-
+ }
+ 
- export function MyHeadersComponent() {
+ export function MyHeadersComponent() {
-   const h = (headers() as unknown as UnsafeUnwrappedHeaders)
+   const h = (headers() as unknown as UnsafeUnwrappedHeaders)
-   return <p>{h.get('x-foo')}</p>
+   return <p>{h.get('x-foo')}</p>
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/async-api-type-cast-02

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

- Expected  - 28
+ Received  + 28

- import React from 'react'
+ import React from 'react'
- import { 
+ import { 
-   headers,
+   headers,
-   cookies, 
+   cookies, 
-   draftMode, 
+   draftMode, 
- } from 'next/headers'
-
+ } from 'next/headers'
+ 
- export function MyDraftComponent() {
+ export function MyDraftComponent() {
- if (/* @next-codemod-error Manually await this call and refactor the function to be async */
+ if (/* @next-codemod-error Manually await this call and refactor the function to be async */
- draftMode().isEnabled) {
+ draftMode().isEnabled) {
-     return null
+     return null
-   }
-
+   }
+ 
-   return <p>page</p>
+   return <p>page</p>
- }
-
+ }
+ 
- export function MyCookiesComponent() {
+ export function MyCookiesComponent() {
-   const c = /* @next-codemod-error Manually await this call and refactor the function to be async */
+   const c = /* @next-codemod-error Manually await this call and refactor the function to be async */
-   cookies()
+   cookies()
-   return c.get('name')
+   return c.get('name')
- }
-
+ }
+ 
- export function MyHeadersComponent() {
+ export function MyHeadersComponent() {
-   const h = /* @next-codemod-error Manually await this call and refactor the function to be async */
+   const h = /* @next-codemod-error Manually await this call and refactor the function to be async */
-   headers()
+   headers()
-   return (
+   return (
-     <p>{h.get('x-foo')}</p>
+     <p>{h.get('x-foo')}</p>
-   )
+   )
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/custom-routes-access-api-prop-01

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

- Expected  - 12
+ Received  + 12

- import { headers } from 'next/headers'
-
+ import { headers } from 'next/headers'
+ 
- export const GET = async function() {
+ export const GET = async function() {
-   await headers()
+   await headers()
- }
-
+ }
+ 
- export async function POST() {
+ export async function POST() {
-   await headers()
+   await headers()
- }
-
+ }
+ 
- export async function DELETE() {
+ export async function DELETE() {
-   await headers()
+   await headers()
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/generate-metadata-access-api-prop-01

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

- Expected  - 4
+ Received  + 4

- import { headers } from 'next/headers'
-
+ import { headers } from 'next/headers'
+ 
- export async function generateMetadata() {
+ export async function generateMetadata() {
-   await headers()
+   await headers()
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/generate-metadata-access-api-prop-02

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

- Expected  - 4
+ Received  + 4

- import { headers } from 'next/headers'
-
+ import { headers } from 'next/headers'
+ 
- export const generateMetadata = async function() {
+ export const generateMetadata = async function() {
-   await headers()
+   await headers()
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/generate-metadata-access-api-prop-03

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

- Expected  - 5
+ Received  + 5

- import { draftMode } from 'next/headers'
-
+ import { draftMode } from 'next/headers'
+ 
- export async function generateMetadata(props: any) {
+ export async function generateMetadata(props: any) {
-   const params = await props.params
+   const params = await props.params
-   await getMostRecentChangelog(params.slug, (await draftMode()).isEnabled)
+   await getMostRecentChangelog(params.slug, (await draftMode()).isEnabled)
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/origin-name-01-util

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

- Expected  - 5
+ Received  + 5

- import { cookies, type UnsafeUnwrappedCookies } from 'next/headers';
-
+ import { cookies, type UnsafeUnwrappedCookies } from 'next/headers';
+ 
- export default function Foo(): string {
+ export default function Foo(): string {
-   const name = (cookies() as unknown as UnsafeUnwrappedCookies).get('name')
+   const name = (cookies() as unknown as UnsafeUnwrappedCookies).get('name')
-   return name
+   return name
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

● next-async-request-api - dynamic-apis › transforms correctly next-async-request-api-dynamic-apis/origin-name-02-util

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

- Expected  - 6
+ Received  + 6

- import { cookies } from 'next/headers'
-
+ import { cookies } from 'next/headers'
+ 
- export default function Foo() {
+ export default function Foo() {
-   const name = /* @next-codemod-error Manually await this call and refactor the function to be async */
+   const name = /* @next-codemod-error Manually await this call and refactor the function to be async */
-   cookies().get('name')
+   cookies().get('name')
-   return name
+   return name
  }

  53 |
  54 |     it(`transforms correctly ${prefix}`, () => {
> 55 |       runInlineTest(
     |       ^
  56 |         transform,
  57 |         null,
  58 |         {

  at runInlineTest (../node_modules/.pnpm/jscodeshift@17.0.0_@babel+preset-env@7.26.9_@babel+core@7.26.10_/node_modules/jscodeshift/dist/testUtils.js:49:18)
  at Object.runInlineTest (../packages/next-codemod/transforms/__tests__/next-async-request-api-dynamic-apis.test.js:55:7)

@bgw bgw force-pushed the bgw/rm-inject-next-config-template branch from 0cf5afd to e20fb2a Compare November 29, 2025 00:46
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 29, 2025

CodSpeed Performance Report

Merging #86630 will degrade performances by 6.93%

Comparing bgw/rm-inject-next-config-template (e20fb2a) with canary (dae80fb)

Summary

❌ 1 regression
✅ 16 untouched
⏩ 3 skipped1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Mode Benchmark BASE HEAD Change
Simulation react-dom-client.development.js[full] 422.8 ms 454.3 ms -6.93%

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.

Comment on lines -915 to -922
pub struct CacheLifeProfile {
#[serde(skip_serializing_if = "Option::is_none")]
pub stale: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub revalidate: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub expire: Option<u32>,
}
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't actually care what the contents of CacheLifeProfile are, only that we can round-trip it. So serde_json::Value seems like a much simpler/better choice.

@ijjk
Copy link
Member

ijjk commented Nov 29, 2025

Stats from current PR

Default Build (Increase detected ⚠️)
General
vercel/next.js canary vercel/next.js bgw/rm-inject-next-config-template Change
buildDuration 17.3s 17.6s ⚠️ +352ms
buildDurationCached 13.8s 10.7s N/A
nodeModulesSize 458 MB 457 MB N/A
nextStartRea..uration (ms) 712ms 719ms N/A
Client Bundles (main, webpack) Overall increase ⚠️
vercel/next.js canary vercel/next.js bgw/rm-inject-next-config-template Change
4292-HASH.js gzip 4.45 kB N/A N/A
436-HASH.js gzip 5.38 kB 5.32 kB N/A
4779.HASH.js gzip 169 B 169 B
9760-HASH.js gzip 52.5 kB 52.7 kB ⚠️ +112 B
c57d0559-HASH.js gzip 62.3 kB 62.3 kB N/A
framework-HASH.js gzip 59.8 kB 59.8 kB
main-app-HASH.js gzip 253 B 256 B N/A
main-HASH.js gzip 38.4 kB 38.3 kB N/A
webpack-HASH.js gzip 1.69 kB 1.69 kB
Overall change 114 kB 114 kB ⚠️ +112 B
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js bgw/rm-inject-next-config-template Change
polyfills-HASH.js gzip 39.4 kB 39.4 kB
Overall change 39.4 kB 39.4 kB
Client Pages Overall increase ⚠️
vercel/next.js canary vercel/next.js bgw/rm-inject-next-config-template Change
_app-HASH.js gzip 193 B 194 B N/A
_error-HASH.js gzip 182 B 182 B
css-HASH.js gzip 334 B 334 B
dynamic-HASH.js gzip 1.81 kB 1.81 kB N/A
edge-ssr-HASH.js gzip 255 B 254 B N/A
head-HASH.js gzip 350 B 351 B N/A
hooks-HASH.js gzip 384 B 384 B
image-HASH.js gzip 580 B 4.77 kB ⚠️ +4.19 kB
index-HASH.js gzip 260 B 259 B N/A
link-HASH.js gzip 2.5 kB 2.5 kB N/A
routerDirect..HASH.js gzip 316 B 320 B N/A
script-HASH.js gzip 388 B 388 B
withRouter-HASH.js gzip 316 B 314 B N/A
1afbb74e6ecf..834.css gzip 106 B 106 B
Overall change 1.97 kB 6.17 kB ⚠️ +4.19 kB
Client Build Manifests
vercel/next.js canary vercel/next.js bgw/rm-inject-next-config-template Change
_buildManifest.js gzip 737 B 720 B N/A
Overall change 0 B 0 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js bgw/rm-inject-next-config-template Change
index.html gzip 525 B 523 B N/A
link.html gzip 538 B 538 B
withRouter.html gzip 522 B 519 B N/A
Overall change 538 B 538 B
Edge SSR bundle Size
vercel/next.js canary vercel/next.js bgw/rm-inject-next-config-template Change
edge-ssr.js gzip 126 kB 124 kB N/A
page.js gzip 235 kB 232 kB N/A
Overall change 0 B 0 B
Middleware size Overall increase ⚠️
vercel/next.js canary vercel/next.js bgw/rm-inject-next-config-template Change
middleware-b..fest.js gzip 654 B 635 B N/A
middleware-r..fest.js gzip 156 B 156 B
middleware.js gzip 32.8 kB 32.9 kB ⚠️ +107 B
edge-runtime..pack.js gzip 846 B 846 B
Overall change 33.8 kB 33.9 kB ⚠️ +107 B
Next Runtimes Overall increase ⚠️
vercel/next.js canary vercel/next.js bgw/rm-inject-next-config-template Change
app-page-exp...dev.js gzip 301 kB 300 kB N/A
app-page-exp..prod.js gzip 155 kB 154 kB N/A
app-page-tur...dev.js gzip 300 kB 300 kB N/A
app-page-tur..prod.js gzip 155 kB 154 kB N/A
app-page-tur...dev.js gzip 297 kB 296 kB N/A
app-page-tur..prod.js gzip 153 kB 152 kB N/A
app-page.run...dev.js gzip 297 kB 297 kB N/A
app-page.run..prod.js gzip 153 kB 152 kB N/A
app-route-ex...dev.js gzip 68.5 kB 68.5 kB N/A
app-route-ex..prod.js gzip 47.3 kB 47.3 kB N/A
app-route-tu...dev.js gzip 68.5 kB 68.5 kB N/A
app-route-tu..prod.js gzip 47.3 kB 47.3 kB N/A
app-route-tu...dev.js gzip 68.1 kB 68.1 kB N/A
app-route-tu..prod.js gzip 47.1 kB 47.1 kB N/A
app-route.ru...dev.js gzip 68.1 kB 68 kB N/A
app-route.ru..prod.js gzip 47.1 kB 47 kB N/A
dist_client_...dev.js gzip 326 B 326 B
dist_client_...dev.js gzip 328 B 328 B
dist_client_...dev.js gzip 320 B 320 B
dist_client_...dev.js gzip 318 B 318 B
pages-api-tu...dev.js gzip 40.9 kB 40.8 kB N/A
pages-api-tu..prod.js gzip 31 kB 31 kB N/A
pages-api.ru...dev.js gzip 40.8 kB 40.8 kB N/A
pages-api.ru..prod.js gzip 30.9 kB 30.9 kB N/A
pages-turbo....dev.js gzip 50.3 kB 50.3 kB N/A
pages-turbo...prod.js gzip 37.8 kB 37.8 kB N/A
pages.runtim...dev.js gzip 50.3 kB 50.3 kB N/A
pages.runtim..prod.js gzip 37.8 kB 37.8 kB N/A
server.runti..prod.js gzip 59.8 kB 60.4 kB ⚠️ +657 B
Overall change 61.1 kB 61.7 kB ⚠️ +657 B
build cache Overall increase ⚠️
vercel/next.js canary vercel/next.js bgw/rm-inject-next-config-template Change
0.pack gzip 3.1 MB 3.1 MB ⚠️ +2.2 kB
index.pack gzip 93.8 kB 93.5 kB N/A
Overall change 3.1 MB 3.1 MB ⚠️ +2.2 kB
Diff details
Diff for page.js

Diff too large to display

Diff for middleware-b..-manifest.js
@@ -3,92 +3,91 @@ globalThis.__BUILD_MANIFEST = {
   devFiles: [],
   lowPriorityFiles: [],
   rootMainFiles: [
-    "static/chunks/webpack-fcf10f51cee06933.js",
-    "static/chunks/c57d0559-87d7b411668e52b9.js",
-    "static/chunks/9760-1ff065928ecb2e6a.js",
-    "static/chunks/main-app-489e2c6220051252.js",
+    "static/chunks/webpack-c7aff218e9eee7c3.js",
+    "static/chunks/fc3b8630-c8df0ee2ac01c9e8.js",
+    "static/chunks/4936-2a9b354938540a25.js",
+    "static/chunks/main-app-5a285e5eb29c8535.js",
   ],
   rootMainFilesTree: {},
   pages: {
     "/": [
-      "static/chunks/webpack-fcf10f51cee06933.js",
-      "static/chunks/framework-9097e8e7f9a0f6cb.js",
-      "static/chunks/main-a177f1ff425795af.js",
-      "static/chunks/pages/index-9b1f076e9fac03f4.js",
+      "static/chunks/webpack-c7aff218e9eee7c3.js",
+      "static/chunks/framework-e894a2c73c6746db.js",
+      "static/chunks/main-fcec177c2d1be8d6.js",
+      "static/chunks/pages/index-5523fac5e3835d81.js",
     ],
     "/_app": [
-      "static/chunks/webpack-fcf10f51cee06933.js",
-      "static/chunks/framework-9097e8e7f9a0f6cb.js",
-      "static/chunks/main-a177f1ff425795af.js",
-      "static/chunks/pages/_app-443eabb8a4e5c909.js",
+      "static/chunks/webpack-c7aff218e9eee7c3.js",
+      "static/chunks/framework-e894a2c73c6746db.js",
+      "static/chunks/main-fcec177c2d1be8d6.js",
+      "static/chunks/pages/_app-8c07b9dcfad803bd.js",
     ],
     "/_error": [
-      "static/chunks/webpack-fcf10f51cee06933.js",
-      "static/chunks/framework-9097e8e7f9a0f6cb.js",
-      "static/chunks/main-a177f1ff425795af.js",
-      "static/chunks/pages/_error-6b752512a6c1df59.js",
+      "static/chunks/webpack-c7aff218e9eee7c3.js",
+      "static/chunks/framework-e894a2c73c6746db.js",
+      "static/chunks/main-fcec177c2d1be8d6.js",
+      "static/chunks/pages/_error-d96fc1a54d61a013.js",
     ],
     "/css": [
-      "static/chunks/webpack-fcf10f51cee06933.js",
-      "static/chunks/framework-9097e8e7f9a0f6cb.js",
-      "static/chunks/main-a177f1ff425795af.js",
+      "static/chunks/webpack-c7aff218e9eee7c3.js",
+      "static/chunks/framework-e894a2c73c6746db.js",
+      "static/chunks/main-fcec177c2d1be8d6.js",
       "static/css/ded6b86ab9cc0a1f.css",
-      "static/chunks/pages/css-9049095f8d68fcf0.js",
+      "static/chunks/pages/css-a4befe2475e7b7f1.js",
     ],
     "/dynamic": [
-      "static/chunks/webpack-fcf10f51cee06933.js",
-      "static/chunks/framework-9097e8e7f9a0f6cb.js",
-      "static/chunks/main-a177f1ff425795af.js",
-      "static/chunks/pages/dynamic-13423b508b9357ba.js",
+      "static/chunks/webpack-c7aff218e9eee7c3.js",
+      "static/chunks/framework-e894a2c73c6746db.js",
+      "static/chunks/main-fcec177c2d1be8d6.js",
+      "static/chunks/pages/dynamic-5982726453bd01a1.js",
     ],
     "/edge-ssr": [
-      "static/chunks/webpack-fcf10f51cee06933.js",
-      "static/chunks/framework-9097e8e7f9a0f6cb.js",
-      "static/chunks/main-a177f1ff425795af.js",
-      "static/chunks/pages/edge-ssr-69e1b3a57e819753.js",
+      "static/chunks/webpack-c7aff218e9eee7c3.js",
+      "static/chunks/framework-e894a2c73c6746db.js",
+      "static/chunks/main-fcec177c2d1be8d6.js",
+      "static/chunks/pages/edge-ssr-6611d49d885b4aee.js",
     ],
     "/head": [
-      "static/chunks/webpack-fcf10f51cee06933.js",
-      "static/chunks/framework-9097e8e7f9a0f6cb.js",
-      "static/chunks/main-a177f1ff425795af.js",
-      "static/chunks/pages/head-f7d913c23a1370c9.js",
+      "static/chunks/webpack-c7aff218e9eee7c3.js",
+      "static/chunks/framework-e894a2c73c6746db.js",
+      "static/chunks/main-fcec177c2d1be8d6.js",
+      "static/chunks/pages/head-5b00d0ab61ce4b2b.js",
     ],
     "/hooks": [
-      "static/chunks/webpack-fcf10f51cee06933.js",
-      "static/chunks/framework-9097e8e7f9a0f6cb.js",
-      "static/chunks/main-a177f1ff425795af.js",
-      "static/chunks/pages/hooks-497c26b761107c7b.js",
+      "static/chunks/webpack-c7aff218e9eee7c3.js",
+      "static/chunks/framework-e894a2c73c6746db.js",
+      "static/chunks/main-fcec177c2d1be8d6.js",
+      "static/chunks/pages/hooks-fc936af610663c47.js",
     ],
     "/image": [
-      "static/chunks/webpack-fcf10f51cee06933.js",
-      "static/chunks/framework-9097e8e7f9a0f6cb.js",
-      "static/chunks/main-a177f1ff425795af.js",
-      "static/chunks/4292-ea0825bb0c16a737.js",
-      "static/chunks/pages/image-7e7769e30c0e02dc.js",
+      "static/chunks/webpack-c7aff218e9eee7c3.js",
+      "static/chunks/framework-e894a2c73c6746db.js",
+      "static/chunks/main-fcec177c2d1be8d6.js",
+      "static/chunks/pages/image-50232676a62af73d.js",
     ],
     "/link": [
-      "static/chunks/webpack-fcf10f51cee06933.js",
-      "static/chunks/framework-9097e8e7f9a0f6cb.js",
-      "static/chunks/main-a177f1ff425795af.js",
-      "static/chunks/pages/link-7fdc135fa2024739.js",
+      "static/chunks/webpack-c7aff218e9eee7c3.js",
+      "static/chunks/framework-e894a2c73c6746db.js",
+      "static/chunks/main-fcec177c2d1be8d6.js",
+      "static/chunks/pages/link-67afc54938b48e5b.js",
     ],
     "/routerDirect": [
-      "static/chunks/webpack-fcf10f51cee06933.js",
-      "static/chunks/framework-9097e8e7f9a0f6cb.js",
-      "static/chunks/main-a177f1ff425795af.js",
-      "static/chunks/pages/routerDirect-41aacbe853e5a2d3.js",
+      "static/chunks/webpack-c7aff218e9eee7c3.js",
+      "static/chunks/framework-e894a2c73c6746db.js",
+      "static/chunks/main-fcec177c2d1be8d6.js",
+      "static/chunks/pages/routerDirect-d780b8e463346e70.js",
     ],
     "/script": [
-      "static/chunks/webpack-fcf10f51cee06933.js",
-      "static/chunks/framework-9097e8e7f9a0f6cb.js",
-      "static/chunks/main-a177f1ff425795af.js",
-      "static/chunks/pages/script-02909c5224d7541d.js",
+      "static/chunks/webpack-c7aff218e9eee7c3.js",
+      "static/chunks/framework-e894a2c73c6746db.js",
+      "static/chunks/main-fcec177c2d1be8d6.js",
+      "static/chunks/pages/script-fadf26f818c6a9d9.js",
     ],
     "/withRouter": [
-      "static/chunks/webpack-fcf10f51cee06933.js",
-      "static/chunks/framework-9097e8e7f9a0f6cb.js",
-      "static/chunks/main-a177f1ff425795af.js",
-      "static/chunks/pages/withRouter-44eb1a330ebc9a95.js",
+      "static/chunks/webpack-c7aff218e9eee7c3.js",
+      "static/chunks/framework-e894a2c73c6746db.js",
+      "static/chunks/main-fcec177c2d1be8d6.js",
+      "static/chunks/pages/withRouter-f061effa2d48ed55.js",
     ],
   },
 };
Diff for middleware.js

Diff too large to display

Diff for edge-ssr.js
failed to diff
Diff for _buildManifest.js
@@ -611,35 +611,32 @@ self.__BUILD_MANIFEST = (function (a, b, c) {
       numHashes: NaN,
       bitArray: [],
     },
-    "/": ["static\u002Fchunks\u002Fpages\u002Findex-9b1f076e9fac03f4.js"],
+    "/": ["static\u002Fchunks\u002Fpages\u002Findex-5523fac5e3835d81.js"],
     "/_error": [
-      "static\u002Fchunks\u002Fpages\u002F_error-6b752512a6c1df59.js",
+      "static\u002Fchunks\u002Fpages\u002F_error-d96fc1a54d61a013.js",
     ],
     "/css": [
       "static\u002Fcss\u002Fded6b86ab9cc0a1f.css",
-      "static\u002Fchunks\u002Fpages\u002Fcss-9049095f8d68fcf0.js",
+      "static\u002Fchunks\u002Fpages\u002Fcss-a4befe2475e7b7f1.js",
     ],
     "/dynamic": [
-      "static\u002Fchunks\u002Fpages\u002Fdynamic-13423b508b9357ba.js",
+      "static\u002Fchunks\u002Fpages\u002Fdynamic-5982726453bd01a1.js",
     ],
     "/edge-ssr": [
-      "static\u002Fchunks\u002Fpages\u002Fedge-ssr-69e1b3a57e819753.js",
+      "static\u002Fchunks\u002Fpages\u002Fedge-ssr-6611d49d885b4aee.js",
     ],
-    "/head": ["static\u002Fchunks\u002Fpages\u002Fhead-f7d913c23a1370c9.js"],
-    "/hooks": ["static\u002Fchunks\u002Fpages\u002Fhooks-497c26b761107c7b.js"],
-    "/image": [
-      "static\u002Fchunks\u002F4292-ea0825bb0c16a737.js",
-      "static\u002Fchunks\u002Fpages\u002Fimage-7e7769e30c0e02dc.js",
-    ],
-    "/link": ["static\u002Fchunks\u002Fpages\u002Flink-7fdc135fa2024739.js"],
+    "/head": ["static\u002Fchunks\u002Fpages\u002Fhead-5b00d0ab61ce4b2b.js"],
+    "/hooks": ["static\u002Fchunks\u002Fpages\u002Fhooks-fc936af610663c47.js"],
+    "/image": ["static\u002Fchunks\u002Fpages\u002Fimage-50232676a62af73d.js"],
+    "/link": ["static\u002Fchunks\u002Fpages\u002Flink-67afc54938b48e5b.js"],
     "/routerDirect": [
-      "static\u002Fchunks\u002Fpages\u002FrouterDirect-41aacbe853e5a2d3.js",
+      "static\u002Fchunks\u002Fpages\u002FrouterDirect-d780b8e463346e70.js",
     ],
     "/script": [
-      "static\u002Fchunks\u002Fpages\u002Fscript-02909c5224d7541d.js",
+      "static\u002Fchunks\u002Fpages\u002Fscript-fadf26f818c6a9d9.js",
     ],
     "/withRouter": [
-      "static\u002Fchunks\u002Fpages\u002FwithRouter-44eb1a330ebc9a95.js",
+      "static\u002Fchunks\u002Fpages\u002FwithRouter-f061effa2d48ed55.js",
     ],
     sortedPages: [
       "\u002F",
Diff for dynamic-HASH.js
@@ -1,7 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [2291],
   {
-    /***/ 1033: /***/ (
+    /***/ 431: /***/ (
       __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
@@ -9,7 +9,7 @@
       (window.__NEXT_P = window.__NEXT_P || []).push([
         "/dynamic",
         function () {
-          return __webpack_require__(6490);
+          return __webpack_require__(8084);
         },
       ]);
       if (false) {
@@ -18,7 +18,7 @@
       /***/
     },
 
-    /***/ 5323: /***/ (
+    /***/ 2699: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -60,7 +60,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
       const _react = /*#__PURE__*/ _interop_require_default._(
         __webpack_require__(2223)
       );
-      const _loadablecontextsharedruntime = __webpack_require__(9289);
+      const _loadablecontextsharedruntime = __webpack_require__(3785);
       function resolve(obj) {
         return obj && obj.default ? obj.default : obj;
       }
@@ -293,73 +293,34 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
       /***/
     },
 
-    /***/ 6490: /***/ (
+    /***/ 3785: /***/ (
       __unused_webpack_module,
-      __webpack_exports__,
+      exports,
       __webpack_require__
     ) => {
       "use strict";
-      __webpack_require__.r(__webpack_exports__);
-      /* harmony export */ __webpack_require__.d(__webpack_exports__, {
-        /* harmony export */ __N_SSP: () => /* binding */ __N_SSP,
-        /* harmony export */ default: () => __WEBPACK_DEFAULT_EXPORT__,
-        /* harmony export */
+      /* __next_internal_client_entry_do_not_use__  cjs */
+      Object.defineProperty(exports, "__esModule", {
+        value: true,
       });
-      /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
-        __webpack_require__(1503);
-      /* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1__ =
-        __webpack_require__(7320);
-      /* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1___default =
-        /*#__PURE__*/ __webpack_require__.n(
-          next_dynamic__WEBPACK_IMPORTED_MODULE_1__
-        );
-
-      const DynamicHello = next_dynamic__WEBPACK_IMPORTED_MODULE_1___default()(
-        () =>
-          __webpack_require__
-            .e(/* import() */ 4779)
-            .then(__webpack_require__.bind(__webpack_require__, 4779))
-            .then((mod) => mod.Hello),
-        {
-          loadableGenerated: {
-            webpack: () => [/*require.resolve*/ 4779],
-          },
-        }
+      Object.defineProperty(exports, "LoadableContext", {
+        enumerable: true,
+        get: function () {
+          return LoadableContext;
+        },
+      });
+      const _interop_require_default = __webpack_require__(1532);
+      const _react = /*#__PURE__*/ _interop_require_default._(
+        __webpack_require__(2223)
       );
-      const Page = () =>
-        /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
-          react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,
-          {
-            children: [
-              /*#__PURE__*/ (0,
-              react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
-                children: "testing next/dynamic size",
-              }),
-              /*#__PURE__*/ (0,
-              react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
-                DynamicHello,
-                {}
-              ),
-            ],
-          }
-        );
-      var __N_SSP = true;
-      /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = Page;
-
-      /***/
-    },
-
-    /***/ 7320: /***/ (
-      module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      module.exports = __webpack_require__(7340);
+      const LoadableContext = _react.default.createContext(null);
+      if (false) {
+      } //# sourceMappingURL=loadable-context.shared-runtime.js.map
 
       /***/
     },
 
-    /***/ 7340: /***/ (module, exports, __webpack_require__) => {
+    /***/ 6828: /***/ (module, exports, __webpack_require__) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -392,7 +353,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
         __webpack_require__(2223)
       );
       const _loadablesharedruntime = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(5323)
+        __webpack_require__(2699)
       );
       const isServerSide = "object" === "undefined";
       // Normalize loader to return the module as form { default: Component } for `React.lazy`.
@@ -492,29 +453,68 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
       /***/
     },
 
-    /***/ 9289: /***/ (
+    /***/ 7514: /***/ (
+      module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      module.exports = __webpack_require__(6828);
+
+      /***/
+    },
+
+    /***/ 8084: /***/ (
       __unused_webpack_module,
-      exports,
+      __webpack_exports__,
       __webpack_require__
     ) => {
       "use strict";
-      /* __next_internal_client_entry_do_not_use__  cjs */
-      Object.defineProperty(exports, "__esModule", {
-        value: true,
-      });
-      Object.defineProperty(exports, "LoadableContext", {
-        enumerable: true,
-        get: function () {
-          return LoadableContext;
-        },
+      __webpack_require__.r(__webpack_exports__);
+      /* harmony export */ __webpack_require__.d(__webpack_exports__, {
+        /* harmony export */ __N_SSP: () => /* binding */ __N_SSP,
+        /* harmony export */ default: () => __WEBPACK_DEFAULT_EXPORT__,
+        /* harmony export */
       });
-      const _interop_require_default = __webpack_require__(1532);
-      const _react = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(2223)
+      /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
+        __webpack_require__(1503);
+      /* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1__ =
+        __webpack_require__(7514);
+      /* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1___default =
+        /*#__PURE__*/ __webpack_require__.n(
+          next_dynamic__WEBPACK_IMPORTED_MODULE_1__
+        );
+
+      const DynamicHello = next_dynamic__WEBPACK_IMPORTED_MODULE_1___default()(
+        () =>
+          __webpack_require__
+            .e(/* import() */ 9573)
+            .then(__webpack_require__.bind(__webpack_require__, 9573))
+            .then((mod) => mod.Hello),
+        {
+          loadableGenerated: {
+            webpack: () => [/*require.resolve*/ 9573],
+          },
+        }
       );
-      const LoadableContext = _react.default.createContext(null);
-      if (false) {
-      } //# sourceMappingURL=loadable-context.shared-runtime.js.map
+      const Page = () =>
+        /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
+          react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,
+          {
+            children: [
+              /*#__PURE__*/ (0,
+              react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
+                children: "testing next/dynamic size",
+              }),
+              /*#__PURE__*/ (0,
+              react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
+                DynamicHello,
+                {}
+              ),
+            ],
+          }
+        );
+      var __N_SSP = true;
+      /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = Page;
 
       /***/
     },
@@ -524,7 +524,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(1033)
+      __webpack_exec__(431)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for edge-ssr-HASH.js
@@ -1,24 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [676],
   {
-    /***/ 1819: /***/ (
-      __unused_webpack_module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      (window.__NEXT_P = window.__NEXT_P || []).push([
-        "/edge-ssr",
-        function () {
-          return __webpack_require__(7521);
-        },
-      ]);
-      if (false) {
-      }
-
-      /***/
-    },
-
-    /***/ 7521: /***/ (
+    /***/ 983: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -37,13 +20,30 @@
 
       /***/
     },
+
+    /***/ 985: /***/ (
+      __unused_webpack_module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      (window.__NEXT_P = window.__NEXT_P || []).push([
+        "/edge-ssr",
+        function () {
+          return __webpack_require__(983);
+        },
+      ]);
+      if (false) {
+      }
+
+      /***/
+    },
   },
   /******/ (__webpack_require__) => {
     // webpackRuntimeModules
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(1819)
+      __webpack_exec__(985)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for head-HASH.js
@@ -1,34 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [5350],
   {
-    /***/ 619: /***/ (
-      __unused_webpack_module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      (window.__NEXT_P = window.__NEXT_P || []).push([
-        "/head",
-        function () {
-          return __webpack_require__(9891);
-        },
-      ]);
-      if (false) {
-      }
-
-      /***/
-    },
-
-    /***/ 7997: /***/ (
-      module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      module.exports = __webpack_require__(6705);
-
-      /***/
-    },
-
-    /***/ 9891: /***/ (
+    /***/ 1417: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -43,7 +16,7 @@
       /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
         __webpack_require__(1503);
       /* harmony import */ var next_head__WEBPACK_IMPORTED_MODULE_1__ =
-        __webpack_require__(7997);
+        __webpack_require__(5171);
       /* harmony import */ var next_head__WEBPACK_IMPORTED_MODULE_1___default =
         /*#__PURE__*/ __webpack_require__.n(
           next_head__WEBPACK_IMPORTED_MODULE_1__
@@ -76,13 +49,40 @@
 
       /***/
     },
+
+    /***/ 1937: /***/ (
+      __unused_webpack_module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      (window.__NEXT_P = window.__NEXT_P || []).push([
+        "/head",
+        function () {
+          return __webpack_require__(1417);
+        },
+      ]);
+      if (false) {
+      }
+
+      /***/
+    },
+
+    /***/ 5171: /***/ (
+      module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      module.exports = __webpack_require__(7505);
+
+      /***/
+    },
   },
   /******/ (__webpack_require__) => {
     // webpackRuntimeModules
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(619)
+      __webpack_exec__(1937)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for hooks-HASH.js
@@ -1,24 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [9804],
   {
-    /***/ 1679: /***/ (
-      __unused_webpack_module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      (window.__NEXT_P = window.__NEXT_P || []).push([
-        "/hooks",
-        function () {
-          return __webpack_require__(4655);
-        },
-      ]);
-      if (false) {
-      }
-
-      /***/
-    },
-
-    /***/ 4655: /***/ (
+    /***/ 1598: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -76,13 +59,30 @@
 
       /***/
     },
+
+    /***/ 3925: /***/ (
+      __unused_webpack_module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      (window.__NEXT_P = window.__NEXT_P || []).push([
+        "/hooks",
+        function () {
+          return __webpack_require__(1598);
+        },
+      ]);
+      if (false) {
+      }
+
+      /***/
+    },
   },
   /******/ (__webpack_require__) => {
     // webpackRuntimeModules
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(1679)
+      __webpack_exec__(3925)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for image-HASH.js

Diff too large to display

Diff for link-HASH.js
@@ -1,7 +1,338 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [4672],
   {
-    /***/ 69: /***/ (module, exports, __webpack_require__) => {
+    /***/ 1511: /***/ (module, exports, __webpack_require__) => {
+      "use strict";
+
+      Object.defineProperty(exports, "__esModule", {
+        value: true,
+      });
+      Object.defineProperty(exports, "useMergedRef", {
+        enumerable: true,
+        get: function () {
+          return useMergedRef;
+        },
+      });
+      const _react = __webpack_require__(2223);
+      function useMergedRef(refA, refB) {
+        const cleanupA = (0, _react.useRef)(null);
+        const cleanupB = (0, _react.useRef)(null);
+        // NOTE: In theory, we could skip the wrapping if only one of the refs is non-null.
+        // (this happens often if the user doesn't pass a ref to Link/Form/Image)
+        // But this can cause us to leak a cleanup-ref into user code (previously via `<Link legacyBehavior>`),
+        // and the user might pass that ref into ref-merging library that doesn't support cleanup refs
+        // (because it hasn't been updated for React 19)
+        // which can then cause things to blow up, because a cleanup-returning ref gets called with `null`.
+        // So in practice, it's safer to be defensive and always wrap the ref, even on React 19.
+        return (0, _react.useCallback)(
+          (current) => {
+            if (current === null) {
+              const cleanupFnA = cleanupA.current;
+              if (cleanupFnA) {
+                cleanupA.current = null;
+                cleanupFnA();
+              }
+              const cleanupFnB = cleanupB.current;
+              if (cleanupFnB) {
+                cleanupB.current = null;
+                cleanupFnB();
+              }
+            } else {
+              if (refA) {
+                cleanupA.current = applyRef(refA, current);
+              }
+              if (refB) {
+                cleanupB.current = applyRef(refB, current);
+              }
+            }
+          },
+          [refA, refB]
+        );
+      }
+      function applyRef(refA, current) {
+        if (typeof refA === "function") {
+          const cleanup = refA(current);
+          if (typeof cleanup === "function") {
+            return cleanup;
+          } else {
+            return () => refA(null);
+          }
+        } else {
+          refA.current = current;
+          return () => {
+            refA.current = null;
+          };
+        }
+      }
+      if (
+        (typeof exports.default === "function" ||
+          (typeof exports.default === "object" && exports.default !== null)) &&
+        typeof exports.default.__esModule === "undefined"
+      ) {
+        Object.defineProperty(exports.default, "__esModule", {
+          value: true,
+        });
+        Object.assign(exports.default, exports);
+        module.exports = exports.default;
+      } //# sourceMappingURL=use-merged-ref.js.map
+
+      /***/
+    },
+
+    /***/ 2025: /***/ (
+      __unused_webpack_module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      (window.__NEXT_P = window.__NEXT_P || []).push([
+        "/link",
+        function () {
+          return __webpack_require__(4591);
+        },
+      ]);
+      if (false) {
+      }
+
+      /***/
+    },
+
+    /***/ 3267: /***/ (module, exports, __webpack_require__) => {
+      "use strict";
+
+      Object.defineProperty(exports, "__esModule", {
+        value: true,
+      });
+      Object.defineProperty(exports, "getDomainLocale", {
+        enumerable: true,
+        get: function () {
+          return getDomainLocale;
+        },
+      });
+      const _normalizetrailingslash = __webpack_require__(2371);
+      const basePath =
+        /* unused pure expression or super */ null && (false || "");
+      function getDomainLocale(path, locale, locales, domainLocales) {
+        if (false) {
+        } else {
+          return false;
+        }
+      }
+      if (
+        (typeof exports.default === "function" ||
+          (typeof exports.default === "object" && exports.default !== null)) &&
+        typeof exports.default.__esModule === "undefined"
+      ) {
+        Object.defineProperty(exports.default, "__esModule", {
+          value: true,
+        });
+        Object.assign(exports.default, exports);
+        module.exports = exports.default;
+      } //# sourceMappingURL=get-domain-locale.js.map
+
+      /***/
+    },
+
+    /***/ 4591: /***/ (
+      __unused_webpack_module,
+      __webpack_exports__,
+      __webpack_require__
+    ) => {
+      "use strict";
+      __webpack_require__.r(__webpack_exports__);
+      /* harmony export */ __webpack_require__.d(__webpack_exports__, {
+        /* harmony export */ __N_SSP: () => /* binding */ __N_SSP,
+        /* harmony export */ default: () => __WEBPACK_DEFAULT_EXPORT__,
+        /* harmony export */
+      });
+      /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
+        __webpack_require__(1503);
+      /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1__ =
+        __webpack_require__(6929);
+      /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1___default =
+        /*#__PURE__*/ __webpack_require__.n(
+          next_link__WEBPACK_IMPORTED_MODULE_1__
+        );
+
+      function aLink(props) {
+        return /*#__PURE__*/ (0,
+        react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
+          children: [
+            /*#__PURE__*/ (0,
+            react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", {
+              children: "A Link page!",
+            }),
+            /*#__PURE__*/ (0,
+            react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
+              next_link__WEBPACK_IMPORTED_MODULE_1___default(),
+              {
+                href: "/",
+                children: "Go to /",
+              }
+            ),
+          ],
+        });
+      }
+      var __N_SSP = true;
+      /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = aLink;
+
+      /***/
+    },
+
+    /***/ 6929: /***/ (
+      module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      module.exports = __webpack_require__(8885);
+
+      /***/
+    },
+
+    /***/ 7686: /***/ (module, exports, __webpack_require__) => {
+      "use strict";
+
+      Object.defineProperty(exports, "__esModule", {
+        value: true,
+      });
+      Object.defineProperty(exports, "useIntersection", {
+        enumerable: true,
+        get: function () {
+          return useIntersection;
+        },
+      });
+      const _react = __webpack_require__(2223);
+      const _requestidlecallback = __webpack_require__(901);
+      const hasIntersectionObserver =
+        typeof IntersectionObserver === "function";
+      const observers = new Map();
+      const idList = [];
+      function createObserver(options) {
+        const id = {
+          root: options.root || null,
+          margin: options.rootMargin || "",
+        };
+        const existing = idList.find(
+          (obj) => obj.root === id.root && obj.margin === id.margin
+        );
+        let instance;
+        if (existing) {
+          instance = observers.get(existing);
+          if (instance) {
+            return instance;
+          }
+        }
+        const elements = new Map();
+        const observer = new IntersectionObserver((entries) => {
+          entries.forEach((entry) => {
+            const callback = elements.get(entry.target);
+            const isVisible =
+              entry.isIntersecting || entry.intersectionRatio > 0;
+            if (callback && isVisible) {
+              callback(isVisible);
+            }
+          });
+        }, options);
+        instance = {
+          id,
+          observer,
+          elements,
+        };
+        idList.push(id);
+        observers.set(id, instance);
+        return instance;
+      }
+      function observe(element, callback, options) {
+        const { id, observer, elements } = createObserver(options);
+        elements.set(element, callback);
+        observer.observe(element);
+        return function unobserve() {
+          elements.delete(element);
+          observer.unobserve(element);
+          // Destroy observer when there's nothing left to watch:
+          if (elements.size === 0) {
+            observer.disconnect();
+            observers.delete(id);
+            const index = idList.findIndex(
+              (obj) => obj.root === id.root && obj.margin === id.margin
+            );
+            if (index > -1) {
+              idList.splice(index, 1);
+            }
+          }
+        };
+      }
+      function useIntersection({ rootRef, rootMargin, disabled }) {
+        const isDisabled = disabled || !hasIntersectionObserver;
+        const [visible, setVisible] = (0, _react.useState)(false);
+        const elementRef = (0, _react.useRef)(null);
+        const setElement = (0, _react.useCallback)((element) => {
+          elementRef.current = element;
+        }, []);
+        (0, _react.useEffect)(() => {
+          if (hasIntersectionObserver) {
+            if (isDisabled || visible) return;
+            const element = elementRef.current;
+            if (element && element.tagName) {
+              const unobserve = observe(
+                element,
+                (isVisible) => isVisible && setVisible(isVisible),
+                {
+                  root: rootRef?.current,
+                  rootMargin,
+                }
+              );
+              return unobserve;
+            }
+          } else {
+            if (!visible) {
+              const idleCallback = (0,
+              _requestidlecallback.requestIdleCallback)(() => setVisible(true));
+              return () =>
+                (0, _requestidlecallback.cancelIdleCallback)(idleCallback);
+            }
+          }
+          // eslint-disable-next-line react-hooks/exhaustive-deps
+        }, [isDisabled, rootMargin, rootRef, visible, elementRef.current]);
+        const resetVisible = (0, _react.useCallback)(() => {
+          setVisible(false);
+        }, []);
+        return [setElement, visible, resetVisible];
+      }
+      if (
+        (typeof exports.default === "function" ||
+          (typeof exports.default === "object" && exports.default !== null)) &&
+        typeof exports.default.__esModule === "undefined"
+      ) {
+        Object.defineProperty(exports.default, "__esModule", {
+          value: true,
+        });
+        Object.assign(exports.default, exports);
+        module.exports = exports.default;
+      } //# sourceMappingURL=use-intersection.js.map
+
+      /***/
+    },
+
+    /***/ 8101: /***/ (__unused_webpack_module, exports) => {
+      "use strict";
+
+      Object.defineProperty(exports, "__esModule", {
+        value: true,
+      });
+      Object.defineProperty(exports, "errorOnce", {
+        enumerable: true,
+        get: function () {
+          return errorOnce;
+        },
+      });
+      let errorOnce = (_) => {};
+      if (false) {
+      } //# sourceMappingURL=error-once.js.map
+
+      /***/
+    },
+
+    /***/ 8885: /***/ (module, exports, __webpack_require__) => {
       "use strict";
       /* __next_internal_client_entry_do_not_use__  cjs */
       Object.defineProperty(exports, "__esModule", {
@@ -28,17 +359,17 @@
       const _react = /*#__PURE__*/ _interop_require_wildcard._(
         __webpack_require__(2223)
       );
-      const _resolvehref = __webpack_require__(2275);
-      const _islocalurl = __webpack_require__(3179);
-      const _formaturl = __webpack_require__(5486);
-      const _utils = __webpack_require__(3708);
-      const _addlocale = __webpack_require__(8225);
-      const _routercontextsharedruntime = __webpack_require__(6046);
-      const _useintersection = __webpack_require__(2678);
-      const _getdomainlocale = __webpack_require__(4499);
-      const _addbasepath = __webpack_require__(7434);
-      const _usemergedref = __webpack_require__(2263);
-      const _erroronce = __webpack_require__(2197);
+      const _resolvehref = __webpack_require__(7379);
+      const _islocalurl = __webpack_require__(4843);
+      const _formaturl = __webpack_require__(9374);
+      const _utils = __webpack_require__(3116);
+      const _addlocale = __webpack_require__(8065);
+      const _routercontextsharedruntime = __webpack_require__(5470);
+      const _useintersection = __webpack_require__(7686);
+      const _getdomainlocale = __webpack_require__(3267);
+      const _addbasepath = __webpack_require__(1450);
+      const _usemergedref = __webpack_require__(1511);
+      const _erroronce = __webpack_require__(8101);
       const prefetched = new Set();
       function prefetch(router, href, as, options) {
         if (false) {
@@ -416,344 +747,13 @@
 
       /***/
     },
-
-    /***/ 2197: /***/ (__unused_webpack_module, exports) => {
-      "use strict";
-
-      Object.defineProperty(exports, "__esModule", {
-        value: true,
-      });
-      Object.defineProperty(exports, "errorOnce", {
-        enumerable: true,
-        get: function () {
-          return errorOnce;
-        },
-      });
-      let errorOnce = (_) => {};
-      if (false) {
-      } //# sourceMappingURL=error-once.js.map
-
-      /***/
-    },
-
-    /***/ 2263: /***/ (module, exports, __webpack_require__) => {
-      "use strict";
-
-      Object.defineProperty(exports, "__esModule", {
-        value: true,
-      });
-      Object.defineProperty(exports, "useMergedRef", {
-        enumerable: true,
-        get: function () {
-          return useMergedRef;
-        },
-      });
-      const _react = __webpack_require__(2223);
-      function useMergedRef(refA, refB) {
-        const cleanupA = (0, _react.useRef)(null);
-        const cleanupB = (0, _react.useRef)(null);
-        // NOTE: In theory, we could skip the wrapping if only one of the refs is non-null.
-        // (this happens often if the user doesn't pass a ref to Link/Form/Image)
-        // But this can cause us to leak a cleanup-ref into user code (previously via `<Link legacyBehavior>`),
-        // and the user might pass that ref into ref-merging library that doesn't support cleanup refs
-        // (because it hasn't been updated for React 19)
-        // which can then cause things to blow up, because a cleanup-returning ref gets called with `null`.
-        // So in practice, it's safer to be defensive and always wrap the ref, even on React 19.
-        return (0, _react.useCallback)(
-          (current) => {
-            if (current === null) {
-              const cleanupFnA = cleanupA.current;
-              if (cleanupFnA) {
-                cleanupA.current = null;
-                cleanupFnA();
-              }
-              const cleanupFnB = cleanupB.current;
-              if (cleanupFnB) {
-                cleanupB.current = null;
-                cleanupFnB();
-              }
-            } else {
-              if (refA) {
-                cleanupA.current = applyRef(refA, current);
-              }
-              if (refB) {
-                cleanupB.current = applyRef(refB, current);
-              }
-            }
-          },
-          [refA, refB]
-        );
-      }
-      function applyRef(refA, current) {
-        if (typeof refA === "function") {
-          const cleanup = refA(current);
-          if (typeof cleanup === "function") {
-            return cleanup;
-          } else {
-            return () => refA(null);
-          }
-        } else {
-          refA.current = current;
-          return () => {
-            refA.current = null;
-          };
-        }
-      }
-      if (
-        (typeof exports.default === "function" ||
-          (typeof exports.default === "object" && exports.default !== null)) &&
-        typeof exports.default.__esModule === "undefined"
-      ) {
-        Object.defineProperty(exports.default, "__esModule", {
-          value: true,
-        });
-        Object.assign(exports.default, exports);
-        module.exports = exports.default;
-      } //# sourceMappingURL=use-merged-ref.js.map
-
-      /***/
-    },
-
-    /***/ 2369: /***/ (
-      __unused_webpack_module,
-      __webpack_exports__,
-      __webpack_require__
-    ) => {
-      "use strict";
-      __webpack_require__.r(__webpack_exports__);
-      /* harmony export */ __webpack_require__.d(__webpack_exports__, {
-        /* harmony export */ __N_SSP: () => /* binding */ __N_SSP,
-        /* harmony export */ default: () => __WEBPACK_DEFAULT_EXPORT__,
-        /* harmony export */
-      });
-      /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
-        __webpack_require__(1503);
-      /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1__ =
-        __webpack_require__(6691);
-      /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1___default =
-        /*#__PURE__*/ __webpack_require__.n(
-          next_link__WEBPACK_IMPORTED_MODULE_1__
-        );
-
-      function aLink(props) {
-        return /*#__PURE__*/ (0,
-        react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
-          children: [
-            /*#__PURE__*/ (0,
-            react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", {
-              children: "A Link page!",
-            }),
-            /*#__PURE__*/ (0,
-            react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
-              next_link__WEBPACK_IMPORTED_MODULE_1___default(),
-              {
-                href: "/",
-                children: "Go to /",
-              }
-            ),
-          ],
-        });
-      }
-      var __N_SSP = true;
-      /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = aLink;
-
-      /***/
-    },
-
-    /***/ 2678: /***/ (module, exports, __webpack_require__) => {
-      "use strict";
-
-      Object.defineProperty(exports, "__esModule", {
-        value: true,
-      });
-      Object.defineProperty(exports, "useIntersection", {
-        enumerable: true,
-        get: function () {
-          return useIntersection;
-        },
-      });
-      const _react = __webpack_require__(2223);
-      const _requestidlecallback = __webpack_require__(4213);
-      const hasIntersectionObserver =
-        typeof IntersectionObserver === "function";
-      const observers = new Map();
-      const idList = [];
-      function createObserver(options) {
-        const id = {
-          root: options.root || null,
-          margin: options.rootMargin || "",
-        };
-        const existing = idList.find(
-          (obj) => obj.root === id.root && obj.margin === id.margin
-        );
-        let instance;
-        if (existing) {
-          instance = observers.get(existing);
-          if (instance) {
-            return instance;
-          }
-        }
-        const elements = new Map();
-        const observer = new IntersectionObserver((entries) => {
-          entries.forEach((entry) => {
-            const callback = elements.get(entry.target);
-            const isVisible =
-              entry.isIntersecting || entry.intersectionRatio > 0;
-            if (callback && isVisible) {
-              callback(isVisible);
-            }
-          });
-        }, options);
-        instance = {
-          id,
-          observer,
-          elements,
-        };
-        idList.push(id);
-        observers.set(id, instance);
-        return instance;
-      }
-      function observe(element, callback, options) {
-        const { id, observer, elements } = createObserver(options);
-        elements.set(element, callback);
-        observer.observe(element);
-        return function unobserve() {
-          elements.delete(element);
-          observer.unobserve(element);
-          // Destroy observer when there's nothing left to watch:
-          if (elements.size === 0) {
-            observer.disconnect();
-            observers.delete(id);
-            const index = idList.findIndex(
-              (obj) => obj.root === id.root && obj.margin === id.margin
-            );
-            if (index > -1) {
-              idList.splice(index, 1);
-            }
-          }
-        };
-      }
-      function useIntersection({ rootRef, rootMargin, disabled }) {
-        const isDisabled = disabled || !hasIntersectionObserver;
-        const [visible, setVisible] = (0, _react.useState)(false);
-        const elementRef = (0, _react.useRef)(null);
-        const setElement = (0, _react.useCallback)((element) => {
-          elementRef.current = element;
-        }, []);
-        (0, _react.useEffect)(() => {
-          if (hasIntersectionObserver) {
-            if (isDisabled || visible) return;
-            const element = elementRef.current;
-            if (element && element.tagName) {
-              const unobserve = observe(
-                element,
-                (isVisible) => isVisible && setVisible(isVisible),
-                {
-                  root: rootRef?.current,
-                  rootMargin,
-                }
-              );
-              return unobserve;
-            }
-          } else {
-            if (!visible) {
-              const idleCallback = (0,
-              _requestidlecallback.requestIdleCallback)(() => setVisible(true));
-              return () =>
-                (0, _requestidlecallback.cancelIdleCallback)(idleCallback);
-            }
-          }
-          // eslint-disable-next-line react-hooks/exhaustive-deps
-        }, [isDisabled, rootMargin, rootRef, visible, elementRef.current]);
-        const resetVisible = (0, _react.useCallback)(() => {
-          setVisible(false);
-        }, []);
-        return [setElement, visible, resetVisible];
-      }
-      if (
-        (typeof exports.default === "function" ||
-          (typeof exports.default === "object" && exports.default !== null)) &&
-        typeof exports.default.__esModule === "undefined"
-      ) {
-        Object.defineProperty(exports.default, "__esModule", {
-          value: true,
-        });
-        Object.assign(exports.default, exports);
-        module.exports = exports.default;
-      } //# sourceMappingURL=use-intersection.js.map
-
-      /***/
-    },
-
-    /***/ 4499: /***/ (module, exports, __webpack_require__) => {
-      "use strict";
-
-      Object.defineProperty(exports, "__esModule", {
-        value: true,
-      });
-      Object.defineProperty(exports, "getDomainLocale", {
-        enumerable: true,
-        get: function () {
-          return getDomainLocale;
-        },
-      });
-      const _normalizetrailingslash = __webpack_require__(1379);
-      const basePath =
-        /* unused pure expression or super */ null && (false || "");
-      function getDomainLocale(path, locale, locales, domainLocales) {
-        if (false) {
-        } else {
-          return false;
-        }
-      }
-      if (
-        (typeof exports.default === "function" ||
-          (typeof exports.default === "object" && exports.default !== null)) &&
-        typeof exports.default.__esModule === "undefined"
-      ) {
-        Object.defineProperty(exports.default, "__esModule", {
-          value: true,
-        });
-        Object.assign(exports.default, exports);
-        module.exports = exports.default;
-      } //# sourceMappingURL=get-domain-locale.js.map
-
-      /***/
-    },
-
-    /***/ 6691: /***/ (
-      module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      module.exports = __webpack_require__(69);
-
-      /***/
-    },
-
-    /***/ 6771: /***/ (
-      __unused_webpack_module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      (window.__NEXT_P = window.__NEXT_P || []).push([
-        "/link",
-        function () {
-          return __webpack_require__(2369);
-        },
-      ]);
-      if (false) {
-      }
-
-      /***/
-    },
   },
   /******/ (__webpack_require__) => {
     // webpackRuntimeModules
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(6771)
+      __webpack_exec__(2025)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for routerDirect-HASH.js
@@ -1,7 +1,34 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [188],
   {
-    /***/ 97: /***/ (
+    /***/ 417: /***/ (
+      __unused_webpack_module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      (window.__NEXT_P = window.__NEXT_P || []).push([
+        "/routerDirect",
+        function () {
+          return __webpack_require__(5491);
+        },
+      ]);
+      if (false) {
+      }
+
+      /***/
+    },
+
+    /***/ 1840: /***/ (
+      module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      module.exports = __webpack_require__(3252);
+
+      /***/
+    },
+
+    /***/ 5491: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -16,7 +43,7 @@
       /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
         __webpack_require__(1503);
       /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_1__ =
-        __webpack_require__(7798);
+        __webpack_require__(1840);
       /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_1___default =
         /*#__PURE__*/ __webpack_require__.n(
           next_router__WEBPACK_IMPORTED_MODULE_1__
@@ -35,40 +62,13 @@
 
       /***/
     },
-
-    /***/ 4283: /***/ (
-      __unused_webpack_module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      (window.__NEXT_P = window.__NEXT_P || []).push([
-        "/routerDirect",
-        function () {
-          return __webpack_require__(97);
-        },
-      ]);
-      if (false) {
-      }
-
-      /***/
-    },
-
-    /***/ 7798: /***/ (
-      module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      module.exports = __webpack_require__(9300);
-
-      /***/
-    },
   },
   /******/ (__webpack_require__) => {
     // webpackRuntimeModules
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(4283)
+      __webpack_exec__(417)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for script-HASH.js
@@ -1,17 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [1209],
   {
-    /***/ 5964: /***/ (
-      module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      module.exports = __webpack_require__(2010);
-
-      /***/
-    },
-
-    /***/ 7758: /***/ (
+    /***/ 1312: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -26,7 +16,7 @@
       /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
         __webpack_require__(1503);
       /* harmony import */ var next_script__WEBPACK_IMPORTED_MODULE_1__ =
-        __webpack_require__(5964);
+        __webpack_require__(2398);
       /* harmony import */ var next_script__WEBPACK_IMPORTED_MODULE_1___default =
         /*#__PURE__*/ __webpack_require__.n(
           next_script__WEBPACK_IMPORTED_MODULE_1__
@@ -59,7 +49,17 @@
       /***/
     },
 
-    /***/ 8803: /***/ (
+    /***/ 2398: /***/ (
+      module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      module.exports = __webpack_require__(8954);
+
+      /***/
+    },
+
+    /***/ 4305: /***/ (
       __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
@@ -67,7 +67,7 @@
       (window.__NEXT_P = window.__NEXT_P || []).push([
         "/script",
         function () {
-          return __webpack_require__(7758);
+          return __webpack_require__(1312);
         },
       ]);
       if (false) {
@@ -81,7 +81,7 @@
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(8803)
+      __webpack_exec__(4305)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for withRouter-HASH.js
@@ -1,7 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [3263],
   {
-    /***/ 184: /***/ (
+    /***/ 358: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -16,7 +16,7 @@
       /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
         __webpack_require__(1503);
       /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_1__ =
-        __webpack_require__(7798);
+        __webpack_require__(1840);
       /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_1___default =
         /*#__PURE__*/ __webpack_require__.n(
           next_router__WEBPACK_IMPORTED_MODULE_1__
@@ -35,7 +35,17 @@
       /***/
     },
 
-    /***/ 3163: /***/ (
+    /***/ 1840: /***/ (
+      module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      module.exports = __webpack_require__(3252);
+
+      /***/
+    },
+
+    /***/ 4041: /***/ (
       __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
@@ -43,7 +53,7 @@
       (window.__NEXT_P = window.__NEXT_P || []).push([
         "/withRouter",
         function () {
-          return __webpack_require__(184);
+          return __webpack_require__(358);
         },
       ]);
       if (false) {
@@ -51,23 +61,13 @@
 
       /***/
     },
-
-    /***/ 7798: /***/ (
-      module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      module.exports = __webpack_require__(9300);
-
-      /***/
-    },
   },
   /******/ (__webpack_require__) => {
     // webpackRuntimeModules
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(3163)
+      __webpack_exec__(4041)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for 4292-HASH.js
deleted
Diff for 436-HASH.js

Diff too large to display

Diff for 9760-HASH.js
failed to diff
Diff for main-HASH.js

Diff too large to display

Diff for app-page-exp..ntime.dev.js
failed to diff
Diff for app-page-exp..time.prod.js

Diff too large to display

Diff for app-page-tur..ntime.dev.js
failed to diff
Diff for app-page-tur..time.prod.js

Diff too large to display

Diff for app-page-tur..ntime.dev.js
failed to diff
Diff for app-page-tur..time.prod.js

Diff too large to display

Diff for app-page.runtime.dev.js
failed to diff
Diff for app-page.runtime.prod.js

Diff too large to display

Diff for app-route-ex..ntime.dev.js

Diff too large to display

Diff for app-route-ex..time.prod.js

Diff too large to display

Diff for app-route-tu..ntime.dev.js

Diff too large to display

Diff for app-route-tu..time.prod.js

Diff too large to display

Diff for app-route-tu..ntime.dev.js

Diff too large to display

Diff for app-route-tu..time.prod.js

Diff too large to display

Diff for app-route.runtime.dev.js

Diff too large to display

Diff for app-route.ru..time.prod.js

Diff too large to display

Diff for pages-api-tu..ntime.dev.js

Diff too large to display

Diff for pages-api-tu..time.prod.js

Diff too large to display

Diff for pages-api.runtime.dev.js

Diff too large to display

Diff for pages-api.ru..time.prod.js

Diff too large to display

Diff for pages-turbo...ntime.dev.js

Diff too large to display

Diff for pages-turbo...time.prod.js

Diff too large to display

Diff for pages.runtime.dev.js

Diff too large to display

Diff for pages.runtime.prod.js

Diff too large to display

Diff for server.runtime.prod.js

Diff too large to display

Commit: e20fb2a

@mischnic mischnic mentioned this pull request Dec 2, 2025
4 tasks
@mischnic mischnic force-pushed the bgw/rm-inject-next-config-template branch from e20fb2a to 3efe766 Compare December 2, 2025 16:09
@mischnic mischnic changed the base branch from canary to graphite-base/86630 December 3, 2025 14:37
@mischnic mischnic force-pushed the bgw/rm-inject-next-config-template branch from 3efe766 to 0705706 Compare December 3, 2025 14:37
@mischnic mischnic changed the base branch from graphite-base/86630 to mischnic/required-server-files-manifest-edge December 3, 2025 14:38
@mischnic mischnic force-pushed the bgw/rm-inject-next-config-template branch from 0705706 to e229752 Compare December 3, 2025 15:08
@mischnic mischnic changed the base branch from mischnic/required-server-files-manifest-edge to graphite-base/86630 December 3, 2025 16:32
@mischnic mischnic force-pushed the graphite-base/86630 branch from 8810a87 to fdf9c6e Compare December 3, 2025 16:34
@mischnic mischnic force-pushed the bgw/rm-inject-next-config-template branch from e229752 to f8d9cd2 Compare December 3, 2025 16:34
@mischnic mischnic changed the base branch from graphite-base/86630 to mischnic/required-server-files-manifest-edge December 3, 2025 16:35
@mischnic mischnic changed the base branch from mischnic/required-server-files-manifest-edge to graphite-base/86630 December 3, 2025 17:12
@mischnic mischnic force-pushed the bgw/rm-inject-next-config-template branch from f8d9cd2 to e20fb2a Compare December 4, 2025 16:40
@mischnic mischnic force-pushed the graphite-base/86630 branch from fdf9c6e to dae80fb Compare December 4, 2025 16:40
@mischnic mischnic changed the base branch from graphite-base/86630 to canary December 4, 2025 16:40
const {
query,
params,
nextConfig,
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to edge-ssr.ts, the edge-ssr-app.ts template extracts nextConfig from prepareResult but globalThis.nextConfig is no longer being set, causing nextConfig to be an empty object that will fail when accessing its properties.

View Details
📝 Patch Details
diff --git a/packages/next/src/build/entries.ts b/packages/next/src/build/entries.ts
index e48f0573b4..320561a8d7 100644
--- a/packages/next/src/build/entries.ts
+++ b/packages/next/src/build/entries.ts
@@ -680,6 +680,7 @@ export function getEdgeServerEntry(opts: {
     isServerComponent: opts.isServerComponent,
     page: opts.page,
     cacheMaxMemorySize: JSON.stringify(opts.config.cacheMaxMemorySize),
+    nextConfig: Buffer.from(JSON.stringify(opts.config)).toString('base64'),
     pagesType: opts.pagesType,
     appDirLoader: Buffer.from(opts.appDirLoader || '').toString('base64'),
     sriEnabled: !opts.isDev && !!opts.config.experimental.sri?.algorithm,
diff --git a/packages/next/src/build/templates/edge-ssr-app.ts b/packages/next/src/build/templates/edge-ssr-app.ts
index ba39c22871..b8d5a8c74a 100644
--- a/packages/next/src/build/templates/edge-ssr-app.ts
+++ b/packages/next/src/build/templates/edge-ssr-app.ts
@@ -24,11 +24,14 @@ import { interopDefault } from '../../lib/interop-default'
 import { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'
 import { checkIsOnDemandRevalidate } from '../../server/api-utils'
 import { CloseController } from '../../server/web/web-on-close'
+import type { NextConfigComplete } from '../../server/config-shared'
 
 declare const incrementalCacheHandler: any
 declare const cacheMaxMemorySize: number
+declare const nextConfig: NextConfigComplete
 // OPTIONAL_IMPORT:incrementalCacheHandler
 // INJECT:cacheMaxMemorySize
+// INJECT:nextConfig
 
 // Initialize the cache handlers interface.
 initializeCacheHandlers(cacheMaxMemorySize)
@@ -76,7 +79,6 @@ async function requestHandler(
   const {
     query,
     params,
-    nextConfig,
     buildId,
     buildManifest,
     prerenderManifest,
diff --git a/packages/next/src/build/templates/edge-ssr.ts b/packages/next/src/build/templates/edge-ssr.ts
index ad3fdd40c9..ceebc51115 100644
--- a/packages/next/src/build/templates/edge-ssr.ts
+++ b/packages/next/src/build/templates/edge-ssr.ts
@@ -25,13 +25,16 @@ import type { RenderResultMetadata } from '../../server/render-result'
 import { getTracer, SpanKind, type Span } from '../../server/lib/trace/tracer'
 import { BaseServerSpan } from '../../server/lib/trace/constants'
 import { HTML_CONTENT_TYPE_HEADER } from '../../lib/constants'
+import type { NextConfigComplete } from '../../server/config-shared'
 
 // injected by the loader afterwards.
 declare const cacheMaxMemorySize: number
+declare const nextConfig: NextConfigComplete
 declare const pageRouteModuleOptions: any
 declare const errorRouteModuleOptions: any
 declare const user500RouteModuleOptions: any
 // INJECT:cacheMaxMemorySize
+// INJECT:nextConfig
 // INJECT:pageRouteModuleOptions
 // INJECT:errorRouteModuleOptions
 // INJECT:user500RouteModuleOptions
@@ -102,7 +105,6 @@ async function requestHandler(
   const {
     query,
     params,
-    nextConfig,
     buildId,
     isNextDataRequest,
     buildManifest,
diff --git a/packages/next/src/build/webpack/loaders/next-edge-ssr-loader/index.ts b/packages/next/src/build/webpack/loaders/next-edge-ssr-loader/index.ts
index 85db21c2d5..637e2fa106 100644
--- a/packages/next/src/build/webpack/loaders/next-edge-ssr-loader/index.ts
+++ b/packages/next/src/build/webpack/loaders/next-edge-ssr-loader/index.ts
@@ -20,6 +20,7 @@ export type EdgeSSRLoaderQuery = {
   isServerComponent: boolean
   page: string
   cacheMaxMemorySize: string
+  nextConfig: string
   appDirLoader?: string
   pagesType: PAGE_TYPES
   sriEnabled: boolean
@@ -74,6 +75,7 @@ const edgeSSRLoader: webpack.LoaderDefinitionFunction<EdgeSSRLoaderQuery> =
       absoluteErrorPath,
       isServerComponent,
       cacheMaxMemorySize: cacheMaxMemorySizeStringified,
+      nextConfig: nextConfigBase64,
       appDirLoader: appDirLoaderBase64,
       pagesType,
       cacheHandler,
@@ -94,6 +96,10 @@ const edgeSSRLoader: webpack.LoaderDefinitionFunction<EdgeSSRLoaderQuery> =
       Buffer.from(middlewareConfigBase64, 'base64').toString()
     )
 
+    const nextConfig = JSON.parse(
+      Buffer.from(nextConfigBase64 || '', 'base64').toString()
+    )
+
     const appDirLoader = Buffer.from(
       appDirLoaderBase64 || '',
       'base64'
@@ -158,6 +164,7 @@ const edgeSSRLoader: webpack.LoaderDefinitionFunction<EdgeSSRLoaderQuery> =
         },
         {
           cacheMaxMemorySize: cacheMaxMemorySizeStringified,
+          nextConfig: JSON.stringify(nextConfig),
         },
         {
           incrementalCacheHandler: cacheHandler ?? null,
@@ -175,6 +182,7 @@ const edgeSSRLoader: webpack.LoaderDefinitionFunction<EdgeSSRLoaderQuery> =
         },
         {
           cacheMaxMemorySize: cacheMaxMemorySizeStringified,
+          nextConfig: JSON.stringify(nextConfig),
           pageRouteModuleOptions: JSON.stringify(getRouteModuleOptions(page)),
           errorRouteModuleOptions: JSON.stringify(
             getRouteModuleOptions('/_error')

Analysis

Missing nextConfig injection in edge SSR templates causes property access failures

What fails: The edge SSR templates (edge-ssr-app.ts and edge-ssr.ts) access properties on nextConfig that are undefined after incomplete refactoring, causing incorrect rendering context values and potential runtime errors for features like asset prefix, image optimization, cache configuration, and experimental features.

How to reproduce: Build and deploy a Next.js application using the edge runtime with app router features that depend on nextConfig properties:

# Build with edge runtime enabled
npm run build

# Any request to an app route at edge runtime will receive incorrect config values:
# - nextConfig.assetPrefix → undefined
# - nextConfig.experimental.taint → undefined
# - nextConfig.cacheLife → undefined
# - nextConfig.images → undefined
# etc.

Result: WIP commit e20fb2a ("perf: Don't inject the entire nextConfig in edge templates") removed the nextConfig injection from edge templates but failed to complete the migration. The templates still destructured nextConfig from prepareResult, which in edge runtime comes from globalThis.nextConfig || {} (set in route-module.ts line 227). Since globalThis.nextConfig is never initialized in edge runtime, it defaults to an empty object {}, causing all nextConfig property accesses to return undefined.

The affected code paths in edge-ssr-app.ts (lines 141-163) and edge-ssr.ts (lines 142-157) set renderContext properties using these undefined values:

  • assetPrefix: nextConfig.assetPrefix → undefined
  • nextConfigOutput: nextConfig.output → undefined
  • experimental.taint: nextConfig.experimental.taint → undefined
  • And 15+ other config properties

Expected: All nextConfig properties should have their actual values from next.config.js, not undefined. The edge template bundle should include the full nextConfig via proper injection (as in commit predecessor).

Fix: Restored the nextConfig injection pattern that was removed in the incomplete WIP commit:

  1. Re-added nextConfig parameter to EdgeSSRLoaderQuery type
  2. Updated entries.ts to pass base64-encoded nextConfig to the loader
  3. Updated next-edge-ssr-loader to decode and inject nextConfig
  4. Updated edge-ssr-app.ts and edge-ssr.ts templates to declare and use injected nextConfig instead of destructuring from prepareResult

mischnic added a commit that referenced this pull request Dec 5, 2025
A separate manifest (`required-server-files.js`, like `_buildManifest.js`) so that we the bundler doesn't have to inline the whole config.

The Node.js runtime routes already get their nextConfig at runtime by reading `required-server-files.js`.

Closes #86630

Context for `initializeCacheHandlers`: #76130
@mischnic mischnic deleted the bgw/rm-inject-next-config-template branch December 5, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants