1. 18 Jul, 2025 12 commits
    • nextjs-bot's avatar
      v15.4.2-canary.8 · a1493307
      nextjs-bot authored
      a1493307
    • Hendrik Liebau's avatar
      Refactor: Get rid of overly generic `getExpectedRequestStore` function (#81791) · 55e90412
      Hendrik Liebau authored
      The places in which we called `getExpectedRequestStore()` were already narrowing down the work unit store type to a request store. This allows us to delete the function, and call `throwForMissingRequestStore()` directly instead.
      55e90412
    • Niklas Mischkulnig's avatar
    • Hendrik Liebau's avatar
      Add VSCode tasks to show TypeScript compilation errors in problems view (#81799) · 298acda3
      Hendrik Liebau authored
      Showing compilation errors for files that aren't currently open is very useful during refactorings.
      
      https://github.com/user-attachments/assets/629f8f2a-37ba-44c1-be6d-9a2e0f93e4f1
      298acda3
    • Sebastian "Sebbie" Silbermann's avatar
    • nextjs-bot's avatar
    • Hendrik Liebau's avatar
      Properly handle hanging promise rejections during prerendering (#81754) · 2256b6be
      Hendrik Liebau authored
      We are using hanging promises for excluding request-specific data from a
      prerender. When prerendering is aborted, we reject all hanging promises.
      In dev mode, React uses these rejections to construct more detailed
      owner stacks. This allows us to provide better errors during the
      prerender validation.
      
      For this to work reliably, we need to ensure that all hanging promises
      are rejected after React's rendering is aborted. However, some hanging
      promises are created before React starts rendering (when creating the
      RSC component tree). Furthermore, for memory reasons, the first hanging
      promise adds a single abort listener that's shared with all subsequent
      hanging promises (see #77480). In this case, the shared abort listener
      for rejections is added before React can add its own abort listener.
      
      When using the same abort signal for both the React render and the
      hanging promises, the hanging promises would be rejected too early,
      preventing React from properly constructing the owner stacks.
      
      To ensure that the order of operations is correct, we now use a separate
      abort signal for React's rendering that is aborted before the "render
      signal" [^1], which is used by the hanging promises, is aborted. For
      parity, we're doing this not only in dev mode but also in production
      mode, so that the hanging promise rejection handling is always the same.
      
      Technically, I don't think this change is necessary for the SSR
      prerender pass, but it felt cleaner to apply it there as well. However,
      we could revisit that when we properly split the two prerender stores.
      For example, the `cacheSignal` and `prerenderResumeDataCache` also don't
      need to be present on the client prerender store.
      
      Reverts #81501.
      
      [^1]: This is an unfortunate name clash. We could also call this one
      "cache signal", which would be in line with `React.cacheSignal()` – its
      potential successor. But that clashes with our current `cacheSignal`,
      which tracks the cache reads. We might revisit this naming problem in a
      future PR.
      2256b6be
    • Wyatt Johnson's avatar
      refactor: rename experimental.dynamicIO to experimental.cacheComponents (#81562) · 8abbb3dc
      Wyatt Johnson authored
      ## What?
      
      Rename `experimental.dynamicIO` to `experimental.cacheComponents` across
      the Next.js codebase.
      
      ## Why?
      
      We're going to be merging the functionality of the `ppr`, `dynamicIO`
      and `useCache` experimental flags into the singular `cacheComponents`
      flag to reduce complexity of the codebase and simplify adoption for
      users wanting to experiment with experimental features.
      
      ## How?
      
      - Renamed the configuration option from `experimental.dynamicIO` to
      `experimental.cacheComponents`
      - Added deprecation handling with automatic migration for the old option
      name
      - Updated all documentation, tests, and internal references
      - Updated Rust code in SWC transforms and Turbopack
      - Maintained backward compatibility with deprecation warnings
      
      NAR-158
      8abbb3dc
    • Wyatt Johnson's avatar
      fix(build): add sourcePage context for PPR dynamic route lambda creation (#81781) · 290ecac9
      Wyatt Johnson authored
      ### What?
      
      This PR adds a `sourcePage` property to dynamic routes in the routes
      manifest to provide the necessary context for lambda creation during the
      build process when PPR is enabled.
      
      ### Why?
      
      The build process was missing the required context to properly create
      lambdas for dynamic routes when PPR is enabled. Without the source page
      information, the build couldn't determine which page a dynamic route
      originated from, preventing correct lambda generation.
      
      ### How?
      
      - Added a new `DynamicManifestRoute` type that extends `ManifestRoute`
      with an optional `sourcePage` property
      - Updated the `pageToRoute` function with overloads to pass the source
      page context
      - Modified the routes manifest generation to include the source page
      when creating dynamic routes for PPR-enabled pages
      - The `sourcePage` property is only populated for app pages when PPR is
      enabled (remains `undefined` for regular dynamic routes)
      
      This ensures the build process has the necessary context to create the
      underlying lambdas correctly.
      290ecac9
    • Benjamin Woodruff's avatar
      Turbopack: Split DynamicEqHash trait into smaller traits in a separate re-usable crate (#81741) · 2817a46d
      Benjamin Woodruff authored
      I originally split this off to support #81742, but I ended up rewriting that PR to not depend on this...
      
      However, I think this is still a code quality improvement, so I'm publishing the PR anyways.
      
      A few notable changes:
      
      - This is now three traits (`DynPartialEq`, `DynEq`, and `DynHash`) instead of one (`DynamicEqHash`)
      - The `Dyn` naming instead of `Dynamic` matches the more common Rust convention.
      - [Trait upcasting is finally stable!](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/#trait-upcasting) Remove the `.as_any()` idiom. Be very careful with the explicit derefs.
      - Fix a bug where the type id was getting added to the hash state twice (once by the `Hash` impl, and a second time by the `DynHash` impl).
      - The `HasherMut` struct isn't really needed, as you can use a `&mut &mut Hasher` instead to work around these dyn compatibility issues in the stdlib.
      
      And finally, `MagicAny` is ported to use these `Dyn` traits to dedupe some logic.
      2817a46d
    • Jiachi Liu's avatar
      [devtool] copy decoded info of error details (#81735) · 7d030a02
      Jiachi Liu authored
      Change the copy button's content from the original error stack trace to a prompt template with error details from the error page and ask AI to fix it. You can copy it for either bug reporting or asking AI agent to explain/fix the errors for you.
      
      ### Example content
      
      A runtime error prompt
      ```
      Fix this error in Next.js app:
      
      ## Error Type
      Runtime Error
      
      ## Error Message
      Error on client
          at Page (app/runtime-error/page.tsx:5:11)
      
      ## Code Frame
        3 | export default function Page() {
        4 |   if (typeof window !== 'undefined') {
      > 5 |     throw new Error('Error on client')
          |           ^
        6 |   }
        7 |   return <p>page</p>
        8 | }
      
      Next.js version: 15.4.2-canary.3 (Webpack)
      
      Explain what's wrong and fix it.
      ```
      
      ### Recordings
      
      | build error | runtime error |
      |:--|:--|
      | <video src="https://github.com/user-attachments/assets/f31c935e-797c-48c7-8e80-5c1bdcde7c5c"> | <video src="https://github.com/user-attachments/assets/15987538-af32-4a32-90e7-1bbf08f1d57b"> |
      7d030a02
    • Jiachi Liu's avatar
      [devtool] move font styling to global.css (#81782) · cf1b7194
      Jiachi Liu authored
      Since we have global css reset, we can only need to reset the font style once, not everywhere
      
      Closes NEXT-4628
      cf1b7194
  2. 17 Jul, 2025 15 commits
  3. 16 Jul, 2025 13 commits
    • nextjs-bot's avatar
      v15.4.2-canary.5 · 719bc5e7
      nextjs-bot authored
      719bc5e7
    • Jiachi Liu's avatar
      [devtool] fix duplicate rendered indicator on server (#81729) · 96b31f8e
      Jiachi Liu authored
      There're should be only one indicator rendered when `showIndicator` state is true, the previous condition is not correct since the previous change seem causing indicator always rendered even on SSR. since devtool bundle is also bundled on ssr layer, but the related code should not get executed. We noticed the previous condition will always render the indicator, which likely triggered some `base-ui` browser code to execute on server and crash on windows.
      
      Related #81722
      96b31f8e
    • Hendrik Liebau's avatar
      Improve error handling for `headers`/`cookies`/`draftMode` in `'use cache'` (#81716) · 4e0b1125
      Hendrik Liebau authored
      This ensures that we show a proper error with an error stack
      (potentially source-mapped) when accessing
      `headers`/`cookies`/`draftMode` in `'use cache'`, even when caught in
      user-land code. For `searchParams` (currently triggering a timeout
      error) we'll need a slightly different solution, which will be handled
      in a future PR.
      
      The approach chosen here is somewhat temporary, as we'd like to
      implement compile-time errors instead for accessing any kind of request
      data in `'use cache'` functions. However, this would require a larger
      change to our bundlers.
      
      closes NAR-201
      4e0b1125
    • Zack Tanner's avatar
      fix: pages router metadata bugs with React 19 (#81733) · 63090e20
      Zack Tanner authored
      When we updated `experimental.strictNextHead` to be true in #65418, we
      did not update all spots that would default to true in the case where
      the value was omitted entirely.
      
      This led to the default value not being correctly applied in pages
      router, which resulted in duplicate metadata w/ React 19.
      
      Since we made the flag the default, we can also probably clean up this
      flag all together, but that can be done separately.
      
      Fixes #81655
      Fixes #81689
      63090e20
    • Ben Gubler's avatar
      chore: update username from 'nebrelbug' to 'bgub' (#81734) · 2eac9dcc
      Ben Gubler authored
      ## Update GitHub username in labeler configuration
      
      I just changed my username from "nebrelbug" to "bgub"
      2eac9dcc
    • nextjs-bot's avatar
      v15.4.2-canary.4 · 40d2fa9b
      nextjs-bot authored
      40d2fa9b
    • Wyatt Johnson's avatar
      fix: revert client segment route changes for sub shell generation (#81731) · 9d1e94d5
      Wyatt Johnson authored
      Reverts changes to the `routes-manifest.json` from #81321. Incorrect
      route sorting was causing some routing errors.
      9d1e94d5
    • Sebastian "Sebbie" Silbermann's avatar
    • Luke Sandberg's avatar
      Add an e2e test for the css serving issue (#81683) · a04a5efe
      Luke Sandberg authored
      ## Add a regression test for when a not-found component depends on css and triggers a bug in turbopack
      
      To correctly serve js and css resources during server side rendering we construct a client manifest that lists all the server components and their required resources.  Turbopack has a bug where we fail to collect css that is used by the page if it is also used by a not-found page (and other error handlers as well).
      
      When a not-found component is present all pages pages implicitly depend on this module and depend on it as an early dependency of the generated `app-page.js` file.  This means if a `not-found.js` file (or a global error file) would happen to depend on the same css as a normal component we would associate it as a client-reference of that component instead of any other.  Then on a server side render we would simply omit it.  This PR adds a regression test for this issue.
      
      See  #77861 and  #79535
      a04a5efe
    • Vercel Release Bot's avatar
      Update Rspack production test manifest (#81701) · 5444efa2
      Vercel Release Bot authored
      This auto-generated PR updates the production integration test manifest used when testing Rspack.
      5444efa2
    • Vercel Release Bot's avatar
      Update Rspack development test manifest (#81702) · f0099cd4
      Vercel Release Bot authored
      This auto-generated PR updates the development integration test manifest used when testing Rspack.
      f0099cd4
    • Andrew Clark's avatar
      [Segment Cache] Support dynamic head prefetching (#81677) · f74a1697
      Andrew Clark authored
      Fixes an issue where opting into dynamic prefetching with
      prefetch={true} would not apply to head data (like the title), only the
      page data. Although the head was being sent by the server as part of the
      prefetch response, it wasn't being transferred correctly to the prefetch
      cache.
      
      The net result is that you can now fully prefetch a page with a dynamic
      title without any additional network requests on navigation.
      f74a1697
    • Andrew Clark's avatar
      Fix: createRouterAct "reject" config (#81720) · 964d0634
      Andrew Clark authored
      Fixes a problem with the internal `createRouterAct` testing helper where
      the `block: "reject"` option would not error correctly, leading to
      potential false negatives. I think I accidentally broke this when I
      added the ability to provide an array of expected responses.
      964d0634