- 29 Oct, 2025 20 commits
-
-
nextjs-bot authored
-
Zack Tanner authored
When a server action triggers a redirect, it will return the RSC payload for the destination state in a single roundtrip. This lets us update the UI without needing to waterfall when getting the target page's data. We reject the server action with a special error signaling that the form state should be reset, but otherwise the redirect itself is unnecessary, since we already are handling it in the server action reducer. However, when we introduced Activity for bfCache, this meant navigating back to the previous page would replay the redirect error that was stashed in the `RedirectBoundary`. I incorrectly patched this by just returning the current router state, rather than the redirect destination's state, but this lost the ability to return the updated state in the same roundtrip as the redirect. Instead, this marks the error that gets stashed in the `RedirectBoundary` as being "handled". Re-activating the hidden subtree will now still correctly reset the state (because the boundary handles it), but won't attempt to perform the redirect again. Closes NAR-470
-
Vercel Release Bot authored
This auto-generated PR updates the development integration test manifest used when testing Rspack.
-
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Rspack.
-
Gus Fune authored
### What? This PR refactors the Google Tag Manager implementation on `@next/third-parties`, it rewrites the implementation of the script url, params and types to allow `gtmId` to be optional when a script URL is provided. ### Why? Google released [Google Tag Gateway for Advertisers](https://developers.google.com/tag-platform/tag-manager/gateway/setup-guide?setup=manual) which allows first-party tracking on GTM. When running GTM using the current implementation, it doesn't work because the `?id=` is hardcoded into the implementation as it doesn't consider the possibility of tag gateway or any other setup where the ID is already part of the url. ### How? - Expanded the types - Refactored the initialisation of the script URL - Updated documentation relevant to GTM Closes #81009 Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Josh Story authored
Today the `captureOwnerStack()` function is provided to shared utilities through an AsyncLocalStorage that scopes the method from the appropriate React instance. This is so that external code like patches to sync IO methods can still generate errors with the appropriate React owner information even when the patched code itself is not bundled and can be called from etiher SSR or RSC contexts. This works but it makes plumbing the React instances around tricky. There is a simpler way. Most of the time you can just try both React's. If one gives you a non-null/undefined result then you know you are in that scope. If neither do then you're outside a React scope altogether. In this change I remove `captureOwnerStack()` from the workUnitStore types and just call it from the shared server runtime which gives even external code access to the appropriate React instances for bundled code
-
Sebastian "Sebbie" Silbermann authored
Co-authored-by:graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
-
Joseph authored
Closes: https://github.com/vercel/next.js/issues/85281
-
Hendrik Liebau authored
With `--debug-build-paths` being added in #85052, we can now use this CLI flag in tests, instead of setting the private environment variable `NEXT_PRIVATE_APP_PATHS`. Related to this change, this PR fixes how we print the dev, start and build commands during tests, by properly escaping the CLI arguments. This ensures that the command is copy-pasteable even when the args contain escaped characters.
-
Sebastian "Sebbie" Silbermann authored
`createSandbox` fully isolates the returned session from the existing Next instance by restarting the server. This is wasteful if the existing instance is already started. Some tests called `nextTestSetup()` without `skipStart` which got fixed in this PR. Some tests can just use `patchFile` nowadays instead of `createSandbox`.
-
Joseph authored
-
Joseph authored
-
Hendrik Liebau authored
When defining a `cacheLife` with an expire time below 5 minutes or a revalidate time of 0 we consider the `'use cache'` function dynamic during prerendering, i.e. it will be excluded from the static shell. Similarly, accessing runtime `params` (not defined in `generateStaticParams`) also makes the function dynamic. Those cases require adding a parent suspense boundary. If there's no suspense boundary, we should show an error during prerendering at build time, as well as in development as part of the prerender validation. The latter is currently not working as expected when the `'use cache'` directive is used in a page (or layout) directly. As the added snapshot tests show, no redbox is shown in those cases. This is a known issue that we plan to address separately. We will also follow up with improving the error messages and docs for those dynamic cache cases. This detail got lost in #85087.
-
Andrew Clark authored
Currently the head (i.e. the viewport and the metadata) is stored in the same cache entry as the route tree. This is not ideal because the head may or may not contain application data, and the response can differ depending on the prefetch strategy. We need to be able to re-fetch the head without also invalidating the route tree. This refactors the Segment Cache to treat the head data as a special kind of "segment". It doesn't appear in the route tree, so there's some logic to account for that, but for the most part it reuses all the existing implementation for fetching and caching normal segment data.
-
Sebastian "Sebbie" Silbermann authored
-
Sebastian "Sebbie" Silbermann authored
-
Joseph authored
-
Jiachi Liu authored
-
JJ Kasper authored
This updates manifest with known flakey tests x-ref: https://github.com/vercel/next.js/actions/runs/18886182152/job/53902013243 x-ref: https://github.com/vercel/next.js/actions/runs/18886182152/job/53902013283 x-ref: https://github.com/vercel/next.js/actions/runs/18886182152/job/53902013307
-
JJ Kasper authored
Adds an option to allow continuing tests on error to find all failures in single run also marks jobs as failed if any test failed while running.
-
- 28 Oct, 2025 20 commits
-
-
Zack Tanner authored
When the tree response sends back a static staleTime, we had handling to ensure that it was at minimum 30s, because anything less would mean we'd be discarding static cache entries more frequently than necessary. Currently a value of 0 would result in a prefetch ping loop, because the cache value would be immediately invalidated. This updates our config validation to warn about values lower than 30s and ensures the `getStaleTimeMs` function applies to the value read from env, too.
-
nextjs-bot authored
-
Jiwon Choi authored
-
Jiwon Choi authored
-
Jiwon Choi authored
-
Swarnava Sengupta authored
Looks like `_next/data` is always matched to prevent accidental security issues with protecting the page but not the data route. Documenting using this PR
-
Benjamin Woodruff authored
This is a recreation of my _very first_ Turbopack PR in https://github.com/vercel/turborepo/pull/7206 (reverted in https://github.com/vercel/turborepo/pull/7573) Instead of using a trait upcast helper method, this uses the recently-stabilized trait upcasting compiler feature. I used claude to help write this, but cleaned it up by hand.
-
Sebastian "Sebbie" Silbermann authored
-
Cong-Cong Pan authored
TODO: Rspack currently does not support the hooks and chunk methods required by `ForceCompleteRuntimePlugin`. Temporarily disable `ForceCompleteRuntimePlugin` when using Rspack as the bundler. This plugin ensures complete webpack runtime is available during soft navigation to prevent runtime function errors, but Rspack currently does not support the required compilation hooks and chunk graph APIs. Co-authored-by:Will Binns-Smith <wbinnssmith@gmail.com>
-
Sebastian "Sebbie" Silbermann authored
-
Donny/강동윤 authored
### What? Combined with `codegen-units = 1` (I'll send another PR for this), these two patches reduce the binary size by 4MB (36MB -> 32MB) Before: https://github.com/swc-project/swc/pull/11188#issuecomment-3453793457 (`swc.linux-x64-gnu.node | 36M (37113184 bytes)`) After: https://github.com/swc-project/swc/pull/11190#issuecomment-3453932183 (`swc.linux-x64-gnu.node | 32M (32959328 bytes)`) ### Why? To reduce the binary size ### How?
-
nextjs-bot authored
-
nextjs-bot authored
-
nextjs-bot authored
-
Sebastian "Sebbie" Silbermann authored
-
Niklas Mischkulnig authored
The `.contains("/node_modules/")` condition didn't work for npm, where the path might be `"node_modules/.prisma/client"` This fixes cases of the following error with Prisma and npm ``` Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x". We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs. This is likely caused by tooling that has not copied "libquery_engine-rhel-openssl-3.0.x.so.node" to the deployment folder. Ensure that you ran `prisma generate` and that "libquery_engine-rhel-openssl-3.0.x.so.node" has been copied to "node_modules/.prisma/client". We would appreciate if you could take the time to share some information with us. Please help us by answering a few questions: https://pris.ly/engine-not-found-tooling-investigation The following locations have been searched: /var/task/node_modules/.prisma/client /var/task/node_modules/@prisma/client /vercel/path0/node_modules/@prisma/client /tmp/prisma-engines ``` -
Sebastian "Sebbie" Silbermann authored
-
Jiwon Choi authored
Proxy is not being picked up during prod on Windows. It is because of two reasons: 1. `isAtConventionLevel` condition was false as the dir was `\\` in Windows, but was checking with explicit `/`. 2. `page` value passed to `getStaticInfoIncludingLayouts` function was in `\\proxy` but was expected to be `/proxy`, which is later used for `isProxy` condition. Therefore, the given paths needed to be normalized. Current behavior: https://github.com/vercel/next.js/actions/runs/18872127141/job/53853048061?pr=85443#step:34:160 Closes NEXT-4756
-
Sebastian "Sebbie" Silbermann authored
[test] Exclude likely Next.js internal Components from component stacks in Redbox assertions (#85420)
-
Alessandro Grosselle authored
### What? - Upgrade development dependency **Express** to the latest version (5.1.0). - Replace direct assignment of `apiReq.query` with `Object.defineProperty` to ensure the property is writable, enumerable, and configurable. ### Why? - To use the most up-to-date and supported version of Express instead of a legacy one. - To fix [expressjs/express#6633](https://github.com/expressjs/express/issues/6633), where Express 5.x defines `req.query` as a read-only getter, preventing Next.js from overriding it directly. ### How? - Update the Express version in `package.json` and run `pnpm install` to apply the change. - Replace: ```js apiReq.query = query; ``` With ```js Object.defineProperty(apiReq, 'query', { value: { ...query }, writable: true, enumerable: true, configurable: true, }); ``` --------- Co-authored-by:
Alessandro Grosselle <alessandro.grosselle@adevinta.com> Co-authored-by:
graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by:
Sebastian Beltran <bjohansebas@gmail.com> Co-authored-by:
Tim Neutkens <tim@timneutkens.nl>
-