1. 10 Feb, 2026 9 commits
    • nextjs-bot's avatar
      v16.2.0-canary.34 · a9ecc09b
      nextjs-bot authored
      a9ecc09b
    • Will Binns-Smith's avatar
      Tracing: trace render times as render-path (#89763) · 4d3ccd6a
      Will Binns-Smith authored
      Analagous to the existing compile-path, which records compile times for
      each path in development, we now record path render times as
      `render-path`. It corresponds with the value we write to the tty when
      rendering routes (e.g. `GET / 200 in 228ms (compile: 129ms, render:
      99ms)`).
      
      This change also adds tests for recording hmr data in the trace file.
      
      Test Plan:
      - CI
      - Made changes in a test app and verified the trace file included valid
        entries for these. Confirmed the duration matched what was shown in
      the cli.
      4d3ccd6a
    • Niklas Mischkulnig's avatar
      Improve not-found-with-pages test (#89538) · e8372967
      Niklas Mischkulnig authored
      The fixture contains both App and Pages router
      But the assertions only ever tested the App endpoints
      
      Fixed by https://github.com/vercel/vercel/pull/14878
      
      There is still a bug in the builder:
      ```
      FAIL webpack test/e2e/app-dir/not-found-with-pages-i18n/not-found-with-pages.test.ts (57.396 s)
        not-found-with-pages-i18n
          ✕ should prefer the app router 404 over the pages router 404 when both are present - browser /app-dir/foo (3528 ms)
          ✕ should prefer the app router 404 over the pages router 404 when both are present - browser /foo (401 ms)
          ✓ should prefer the app router 404 over the pages router 404 when both are present - SSR /app-dir/foo (141 ms)
          ✕ should prefer the app router 404 over the pages router 404 when both are present - SSR /foo (249 ms)
      
        ● not-found-with-pages-i18n › should prefer the app router 404 over the pages router 404 when both are present - browser /app-dir/foo
      
          expect(received).toBe(expected) // Object.is equality
      
          Expected: "APP ROUTER - 404 PAGE"
          Received: "PAGES ROUTER - 404 PAGE"
      
            27 |
            28 |       await browser.loadPage(next.url)
          > 29 |       expect(await browser.elementByCss('h1').text()).toBe(
               |                                                       ^
            30 |         'APP ROUTER - 404 PAGE'
            31 |       )
            32 |     }
      
            at toBe (e2e/app-dir/not-found-with-pages-i18n/not-found-with-pages.test.ts:29:55)
      
        ● not-found-with-pages-i18n › should prefer the app router 404 over the pages router 404 when both are present - browser /foo
      
          expect(received).toBe(expected) // Object.is equality
      
          Expected: "APP ROUTER - 404 PAGE"
          Received: "PAGES ROUTER - 404 PAGE"
      
            22 |     async (s) => {
            23 |       const browser = await next.browser(s)
          > 24 |       expect(await browser.elementByCss('h1').text()).toBe(
               |                                                       ^
            25 |         'APP ROUTER - 404 PAGE'
            26 |       )
            27 |
      
            at toBe (e2e/app-dir/not-found-with-pages-i18n/not-found-with-pages.test.ts:24:55)
      
        ● not-found-with-pages-i18n › should prefer the app router 404 over the pages router 404 when both are present - SSR /foo
      
          expect(received).toContain(expected) // indexOf
      
          Expected substring: "APP ROUTER - 404 PAGE"
          Received string:    "<!DOCTYPE html><html lang=\"en\" data-dpl-id=\"dpl_BM4HgVbmReroGBTz3augsyMX43xG\"><head><meta charSet=\"utf-8\" data-next-head=\"\"/><meta name=\"viewport\" content=\"width=device-width\" data-next-head=\"\"/><noscript data-n-css=\"\"></noscript><script defer=\"\" noModule=\"\" src=\"/_next/static/chunks/polyfills-42372ed130431b0a.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\"></script><script src=\"/_next/static/chunks/webpack-70c336f9a46f13b1.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/chunks/framework-8c604becf61eba86.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/chunks/main-16ce12b5863057b2.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/chunks/pages/_app-688aa0c7241baf30.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/chunks/pages/404-b7a49e5d00a03545.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/_buildManifest.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/_ssgManifest.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script></head><body><div id=\"__next\"><div><h1>PAGES ROUTER - 404 PAGE</h1><p>This page is using the PAGES ROUTER</p><p>Custom message fetched at build time</p></div></div><script id=\"__NEXT_DATA__\" type=\"application/json\">{\"props\":{\"pageProps\":{\"message\":\"Custom message fetched at build time\"},\"__N_SSG\":true},\"page\":\"/404\",\"query\":{},\"buildId\":\"build-TfctsWXpff2fKS\",\"isFallback\":false,\"isExperimentalCompile\":false,\"gsp\":true,\"locale\":\"en\",\"locales\":[\"en\",\"en-GB\"],\"defaultLocale\":\"en\",\"scriptLoader\":[]}</script></body></html>"
      
            38 |       const ssr = await next.fetch(s)
            39 |       expect(ssr.status).toEqual(404)
          > 40 |       expect(await ssr.text()).toContain('APP ROUTER - 404 PAGE')
               |                                ^
            41 |     }
            42 |   )
            43 | })
      
            at toContain (e2e/app-dir/not-found-with-pages-i18n/not-found-with-pages.test.ts:40:32)
      ```
      e8372967
    • Tim Neutkens's avatar
      Add 2nd cloned body to FinalizationRegistry. Only used RuntimeStyles component for webpack (#88577) · 53481e3f
      Tim Neutkens authored
      ### What?
      
      Reduces memory retention in two areas: response stream cleanup in
      `cloneResponse` and unnecessary runtime style initialization in
      Turbopack mode. Also adds a test fixture for standalone mode fetch
      memory leak detection.
      
      ### Why?
      
      Based on the reproduction provided in #85914, investigating potential
      sources of memory retention. When a `ReadableStream` is tee'd, both
      branches must be cancelled to release connection resources — previously
      only one branch was registered for GC cancellation. Additionally,
      `RuntimeStyles` and `_N_E_STYLE_LOAD` were always initialized even in
      Turbopack mode where they are unused.
      
      ### How?
      
      **`clone-response.ts`**: Register both `cloned1` and `cloned2` bodies
      with the `FinalizationRegistry` so that when either response is garbage
      collected, its stream branch is properly cancelled.
      
      **`app-router.tsx`**: Guard `_N_E_STYLE_LOAD` and style tracking `Set`
      initialization behind `!process.env.TURBOPACK && typeof window !==
      'undefined'`. Rename the component to `RuntimeStylesForWebpack` and skip
      rendering it entirely when using Turbopack.
      
      Fixes #85914
      
      ---------
      Co-authored-by: 's avatarUnghee Lee <unghee66@gmail.com>
      53481e3f
    • Hendrik Liebau's avatar
      [test] Add regression test for segment cache prefetch memory leak (#89756) · a2409549
      Hendrik Liebau authored
      Follow-up to #89610.
      
      Adds an e2e test that detects linear heap growth caused by unclosed
      prefetch response streams. The test cycles through mounting/unmounting
      links to trigger repeated prefetches and LRU evictions, then uses CDP
      heap profiling with linear regression to verify the heap plateaus rather
      than growing steadily.
      
      
      ![heap-growth-chart](https://github.com/user-attachments/assets/6151c0e4-7ae1-4526-b094-8d76154be664)
      a2409549
    • Abhishek Mardiya's avatar
      clarify unstable_cache replacement with use cache (#89435) · a7a01745
      Abhishek Mardiya authored
      There’s an inconsistency in the docs:
      [unstable_cache](https://nextjs.org/docs/app/api-reference/functions/unstable_cache)
      has already been replaced by use cache, so I think the documentation
      should be updated accordingly.
      I’d appreciate it if you could look into this, should that be the case.
      @icyJoseph
      
      <!-- Thanks for opening a PR! Your contribution is much appreciated.
      To make sure your PR is handled as smoothly as possible we request that
      you follow the checklist sections below.
      Choose the right checklist for the change(s) that you're making:
      
      ## For Contributors
      
      ### Improving Documentation
      
      - Run `pnpm prettier-fix` to fix formatting issues before opening the
      PR.
      - Read the Docs Contribution Guide to ensure your contribution follows
      the docs guidelines:
      https://nextjs.org/docs/community/contribution-guide
      
      ### Fixing a bug
      
      - Related issues linked using `fixes #number`
      - Tests added. See:
      https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
      - Errors have a helpful link attached, see
      https://github.com/vercel/next.js/blob/canary/contributing.md
      
      ### Adding a feature
      
      - Implements an existing feature request or RFC. Make sure the feature
      request has been accepted for implementation before opening a PR. (A
      discussion must be opened, see
      https://github.com/vercel/next.js/discussions/new?category=ideas)
      - Related issues/discussions are linked using `fixes #number`
      - e2e tests added
      (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
      - Documentation added
      - Telemetry added. In case of a feature if it's used or not.
      - Errors have a helpful link attached, see
      https://github.com/vercel/next.js/blob/canary/contributing.md
      
      
      ## For Maintainers
      
      - Minimal description (aim for explaining to someone not on the team to
      understand the PR)
      - When linking to a Slack thread, you might want to share details of the
      conclusion
      - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
      - Add review comments if necessary to explain to the reviewer the logic
      behind a change
      
      ### What?
      
      ### Why?
      
      ### How?
      
      Closes NEXT-
      Fixes #
      
      -->
      Co-authored-by: 's avatarJoseph <joseph.chamochumbi@vercel.com>
      a7a01745
    • Niklas Mischkulnig's avatar
      Pass shouldCache to all manifest loading calls (#89713) · c76b0fe2
      Niklas Mischkulnig authored
      A few calls were missing `shouldCache`
      c76b0fe2
    • Vercel Release Bot's avatar
      Update Rspack development test manifest (#89702) · a1cb030e
      Vercel Release Bot authored
      This auto-generated PR updates the development integration test manifest used when testing Rspack.
      a1cb030e
    • Vercel Release Bot's avatar
      Update Rspack production test manifest (#89701) · e407560d
      Vercel Release Bot authored
      This auto-generated PR updates the production integration test manifest used when testing Rspack.
      e407560d
  2. 09 Feb, 2026 9 commits
  3. 08 Feb, 2026 9 commits
  4. 07 Feb, 2026 6 commits
  5. 06 Feb, 2026 7 commits
    • Maikel van Dort's avatar
      fix: deprecated util._extend (#89614) · 355d4484
      Maikel van Dort authored
      ### What?
      
      Fix deprecated warning: "Use Object.assign instead of deprecated
      util._extend" from http-proxy (which hasn't been updated for 5 years)
      
      ### Why?
      
      ### How?
      
      Fixes #74460
      In favour of https://github.com/vercel/next.js/pull/81544 (which didn't
      use a patch, but manually updated the compiled version)
      355d4484
    • nextjs-bot's avatar
      v16.2.0-canary.30 · 7cd9c707
      nextjs-bot authored
      7cd9c707
    • Niklas Mischkulnig's avatar
      Upgrade rustc to 2026-02-05 (#89591) · 6dfcffe1
      Niklas Mischkulnig authored
      - checked_div 
      - loop -> while
      6dfcffe1
    • Niklas Mischkulnig's avatar
      Fix deployment id header when proxying (#89593) · 522de8c3
      Niklas Mischkulnig authored
      When proxying through multiple projects, this header would get overwritten by the proxy project:
      - the header would be the proxy's deployment id
      - `process.env.NEXT_DEPLOYMENT_ID` would be the origin's deployment id
      
      Needs https://github.com/vercel/vercel/pull/14903
      522de8c3
    • Will Binns-Smith's avatar
      Turbopack: Add --experimental-server-fast-refresh CLI flag (#89274) · 5ea38767
      Will Binns-Smith authored
      This adds `--experimental-server-fast-refresh` CLI flag to enable experimental server-side Fast Refresh (HMR) during development. It's disabled by default.
      
      We call HMR "fast refresh" in public docs so let's keep the flag consistent with that. We use the HMR naming past this outer layer in the codebase.
      
      Test Plan:
      
      ```bash
      next dev --experimental-server-fast-refresh
      ```
      5ea38767
    • Matt Mastracci's avatar
      Turbopack: Pass globals to node.js workers as well (#89261) · a1c12562
      Matt Mastracci authored
      ## What
      
      Changes how Turbopack creates Web Workers and Worker Threads to use a unified factory function pattern. Workers now receive the same runtime globals (like `NEXT_DEPLOYMENT_ID` and `NEXT_CLIENT_ASSET_SUFFIX`) as the parent context, and asset loading works correctly inside workers.
      
      ## Why
      
      Previously, worker creation was split between compile-time URL generation and runtime initialization, which made it difficult to:
      - Forward runtime globals to worker contexts
      - Ensure workers could load chunked assets with the correct suffix
      - Maintain consistent initialization logic across browser and Node.js workers
      
      This caused issues when workers needed to dynamically import assets or access deployment-specific configuration.
      
      ## How
      
      Worker loader modules now export a factory function that receives the Worker constructor and options, rather than just a URL. The runtime handles all worker initialization, including forwarding necessary globals. This keeps all worker creation logic in a single place (the runtime) rather than being split between Rust code generation and JavaScript execution.
      
      Tests added for PNG asset loading in workers to verify the asset suffix forwarding works correctly in both browser and Node.js contexts.
      a1c12562
    • Hendrik Liebau's avatar
      Resolve local variable references in error code SWC plugin (#89596) · 869b45ef
      Hendrik Liebau authored
      The error code plugin now resolves local variable references in error
      constructors to their string literal initializers. Previously, `const
      msg = 'Error text'; throw new Error(msg)` would produce `"%s"` as the
      error message, preventing it from being tracked in `errors.json`. A
      pre-pass `BindingCollector` now collects variable declarations before
      the transformation pass, enabling error code assignment for these
      patterns. This adds 50 new error codes to `errors.json`.
      
      Variable references that still can't be resolved include imported
      constants (cross-module), function return values, object property
      access, and function parameters. These continue to produce `"%s"` as
      before.
      
      Also fixes `rcstr!()` to `.into()`. The `rcstr!` macro was introduced by
      a bulk Turbopack refactor (#80552), but was never available as a
      dependency of this standalone crate. `turbo-rcstr` can't be added as a
      dependency because it uses workspace-level dependency references that
      aren't resolvable from this standalone crate's `Cargo.lock`.
      869b45ef