- 08 Dec, 2025 2 commits
-
-
nextjs-bot authored
-
Jiachi Liu authored
-
- 03 Dec, 2025 3 commits
-
-
nextjs-bot authored
-
JJ Kasper authored
-
Josh Story authored
Update React Version
-
- 30 Nov, 2025 2 commits
-
-
nextjs-bot authored
-
Luke Sandberg authored
e.g. https://github.com/vercel/next.js/runs/56663260329 ``` ● 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` " ``` https://github.com/web-platform-dx/baseline-browser-mapping/issues/105 is discussing this
-
- 26 Nov, 2025 2 commits
-
-
nextjs-bot authored
-
JJ Kasper authored
Backports #85418 to v16 release branch Co-authored-by:Lucas Felicio Adriano <lucas@lucasfadriano.dev>
-
- 24 Nov, 2025 4 commits
-
-
nextjs-bot authored
-
Tobias Koppers authored
### What? Make stuff more type safe. Use destructuring to avoid forgetting fields
-
Zack Tanner authored
When navigating away from a page due to an MPA navigation or browser refresh, we were aborting any pending RSC requests. However, in the case where the abort was due to an MPA navigation, the browser would restore the execution context via the built-in bfcache, and the aborted fetch would cause React to get in an errored state, leading to "BodyStreamBuffer was aborted". Rather than aborting the pending requests, we instead mark that we would have aborted due to the page unloading. That still solves the original reason the flag was added (suppressing the fetch errors that get logged) Fixes NAR-519
-
Jiwon Choi authored
### Why? When Proxy self-references itself, e.g., `__filename`, it is traced to the NFT file. However, since Next.js renames 'proxy.js' to 'middleware.js' during webpack build, the files in NFT will differ from the actual outputs. This can cause a problem when verifying the NFT. Current Behavior: https://github.com/vercel/next.js/actions/runs/19483162554/job/55760669267?pr=86214#step:34:91 ### How? Therefore, also rename the self-reference of `'proxy.js'` in `middleware.js.nft.json` to `'middleware.js'`. I don't expect other modules to be referencing the build output of Proxy, that is not recommended. Closes NEXT-4777 Closes NAR-518 --------- Co-authored-by:
Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
-
- 13 Nov, 2025 2 commits
-
-
nextjs-bot authored
-
Jiachi Liu authored
`is-error` is a helper that being used accorss client and server now, in #84909 we switched the underlying safe stringify error implementation to the precompiled dependency `safe-stable-stringify`. But it increased the client bundle size a bit. The change in #84909 was only for applying the `safe-stable-stringify` for client file logger with mcp, not really necessary need to change for is-error helper Note: Save minified around 12kb. it's actually 7.5kb on bundlephobia, but because we're using ncc to compile it to cjs dependency that the size seems slightly larger than their metrics. The saved gzip size would be around 2-3.x kb
-
- 12 Nov, 2025 25 commits
-
-
Joseph authored
Adding more searchable keywords
-
Joseph authored
-
Niklas Mischkulnig authored
-
Georges Farah authored
The `Auth0` link is broken so I fixed it <!-- 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:
Joseph <joseph.chamochumbi@vercel.com>
-
James Daniels authored
Updates cases where `/` isn't normalized fully when interpolating into data paths and adds regression tests. --------- Co-authored-by:
vercel[bot] <35613825+vercel[bot]@users.noreply.github.com> Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
nextjs-bot authored
-
Zack Tanner authored
It's safer to copy here than to pass a reference, because it's possible that the underlying chunk became detached. Accidentally tweaked this before landing #85595
-
Shu Ding authored
This fixes #85912, as the logic of injecting the `font-family` property should be mirrored from the Webpack implementation.
-
Hendrik Liebau authored
-
Joseph authored
Closes: https://github.com/vercel/next.js/issues/85947
-
Hendrik Liebau authored
This PR fixes a slight performance regression introduced in #85519 where inline async function expressions were created for each unique set of arguments passed to a `'use cache'` function. For a function like this: ```js export async function getCachedData(id) { 'use cache'; return fetch(`/api/data/${id}`); } ``` we were previously generating (simplified): ```js export var $$RSC_SERVER_CACHE_0 = cache("default", "0815", 0, async function(id) { return fetch(`/api/data/${id}`); }); ``` In #85519, we restructured this to ensure proper stack frames in error messages (simplified): ```js export var $$RSC_SERVER_CACHE_0 = React.cache(function getCachedData() { return cache("default", "0815", 0, async function(id) { return fetch(`/api/data/${id}`); }, arguments); }); ``` However, this introduced a small performance issue: the inner async function expression was passed inline to the cache wrapper. While `React.cache` memoizes the outer function, each unique set of arguments would cause a new inner function object to be allocated. Now we're generating (simplified): ```js const $$RSC_SERVER_CACHE_0_INNER = async function getCachedData(id) { return fetch(`/api/data/${id}`); }; export var $$RSC_SERVER_CACHE_0 = React.cache(function getCachedData() { return cache("default", "0815", 0, $$RSC_SERVER_CACHE_0_INNER, arguments); }); ``` The cache implementation is now hoisted to module scope with an `_INNER` suffix as a const declaration with a named function expression. The function name is preserved to ensure proper stack traces in dev. This eliminates the repeated function allocations while preserving the improvements from #85519. -
Hendrik Liebau authored
The `next.browserWithResponse()` test helper is currently only used in the `fallback-shells` test suite, which frequently times out after 10 seconds in CI, because the initial compilation for the first request can take quite a while when there's resource contention. Increasing the timeout to 30 seconds should help mitigate these issues. We could also consider removing the timeout entirely. Playwright also doesn't use a timeout per default for the `page.goto()` method, which we use for `next.browser()` and `next.browserWithResponse()` under the hood.
-
Jude Gao authored
## Problem Telemetry events were not being captured in three scenarios: ### 1. MCP Telemetry Lost on Dev Server Shutdown Two telemetry instances were created during dev server startup. MCP events were recorded to one instance but shutdown flushed a different instance. **Fix:** Reuse the existing telemetry instance from `traceGlobals`. ### 2. Process Exit Timeout Killing Async Telemetry The CLI force-kills child processes after 100ms (`NEXT_EXIT_TIMEOUT_MS`). Async telemetry operations were interrupted before completion. **Fix:** Use `flushDetached()` to write events to disk and spawn a detached process for async submission, allowing immediate parent exit. ### 3. Build Errors Calling `process.exit()` Before Telemetry Flush `process.exit()` calls in error handlers (SWC failures, missing dependencies, route conflicts) bypassed finally blocks and killed processes before telemetry completed. **Fix:** Throw errors instead of calling `process.exit()`, add finally blocks with `await telemetry.flush()` in critical paths. ## Changes **Core:** - `server/dev/next-dev-server.ts`: Reuse telemetry instance - `server/lib/start-server.ts`: Use `flushDetached()` for shutdown - `build/swc/index.ts`: Remove `process.exit()` calls - `build/turbopack-build/impl.ts`: Add telemetry flush in worker finally block - `build/index.ts`: Add telemetry flush in finally block, throw instead of exit - `lib/verify-partytown-setup.ts`: Throw instead of exit **Supporting:** - `telemetry/storage.ts`: Generate unique event files per PID - `telemetry/detached-flush.ts`: Accept optional eventsFile parameter - `errors.json`: Update detached-flush error message ## Testing All telemetry tests now pass: - MCP telemetry on dev server shutdown - SWC load failures in worker threads - Build configuration errors
✅ Non-blocking shutdown✅ Timeout-independent✅ No race conditions✅ Works in worker threads -
nextjs-bot authored
-
Luke Sandberg authored
### What Remove `LocalTaskType::Native` and supporting infrastructure. Simplify schedule_local_task to remove an allocation and `CaptureFuture`. ### Why? local tasks for things other than 'resolve' tasks have been proven to not be a very useful idea. However, for resolve tasks they do still make sense. We can use the small amount of indirection provided by `LocalTask` to optimize how we launch other turbotasks. Now that the local task implementation is clearly just about turbo-tasks infrastructure (rather than calling arbitrary 'user code') we can simplify dispatching a bit.
-
Luke Sandberg authored
## Enable synchronous access to native bindings ## What? This PR refactors the SWC bindings loading mechanism to support synchronous access to bindings after they've been loaded. It introduces new functions `installBindings()` and `getBindingsSync()` to properly manage the bindings lifecycle. `installBindings` is called early by tools that rely on them. There were of course a few complexities: * webpack loaders need to defensively install bindings to support being run by webpack * the hacky `loadNativeSync` method used by `transformSync` remains required due to the jest-transformer API (i didn't see a clear initialization location). * the `experimental.useWasmBinary` configuration is broken by design * if the config is `next.config.ts` when we load SWC to transpile it, but that requires the native bindings, so we might load native bindings even when you ask for wasm. I added a warning message for this case and the workaround is to use the node native transpilation support. * this should probably be a command line flag if it is important * we need to lazily load the `swc/index.ts` module since it transitively loads `react` which reads `NODE_ENV` and various next entrypoints might modify that. ## Why? This makes it clearer that we are correctly applying the `useWasmBinary` option and can simplify some code paths that now don't need to be `async`. This will be important in a future PR where i move some parts of issue formatting into rust/wasm. Having those APIs be async will decrease their usability.
-
Tessa authored
<!-- 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? Added Appwrite Sites to the list of deployment adapters in the deploying documentation. ### Why? Appwrite Sites is a deployment platform that uses an adapter to run Next.js applications on their infrastructure, similar to other platforms listed in the Adapters section (Cloudflare, Netlify, AWS Amplify, etc.). This addition helps developers discover Appwrite Sites as a deployment option for their Next.js applications. ### How? Added a link to Appwrite Sites documentation (https://appwrite.io/docs/products/sites/quick-start/nextjs in the Adapters section of 17-deploying.mdx Closes NEXT- Fixes # --> ### What? Added Appwrite Sites to the list of deployment adapters in the deploying documentation. ### Why? Appwrite Sites is a deployment platform that uses an adapter to run Next.js applications on their infrastructure, similar to other platforms listed in the Adapters section (Cloudflare, Netlify, AWS Amplify, etc.). This addition helps developers discover Appwrite Sites as a deployment option for their Next.js applications. ### How? Added a link to Appwrite Sites documentation (https://appwrite.io/docs/products/sites/quick-start/nextjs in the Adapters section of 17-deploying.mdx
-
Tobias Koppers authored
### What? The previous default of 256 parallel write operations caused a serious performance problem. For a bigger application this change improves write performance by 5.8x (12.8s -> 2.2s) on MacOS.
-
Benjamin Woodruff authored
This was left over from the `turbo-tasks-build` crate, which @lukesandberg eliminated in favor of `inventory`. This crate was used for sharing code between `turbo-tasks-build` and `turbo-tasks-macros`. We can just merge these crates together now. Regarding compilation time: The dependency graph here is pretty linear, so I don't think there's any benefit from splitting these.
-
JJ Kasper authored
The filter condition on the existing tests was incorrect so updated those and added flakey prefetch ones from https://github.com/vercel/next.js/actions/runs/19184159066/job/54847336252 https://github.com/vercel/next.js/actions/runs/19184159066/job/54847336291
-
Vercel Release Bot authored
This auto-generated PR updates font data with latest available Co-authored-by:nextjs-bot <it+nextjs-bot@vercel.com>
-
Zack Tanner authored
Next.js relies on on the Resume Data Cache to prevent tearing between the statically prefetchable parts of the UI by seeding the resume with the same cache as the revalidation/build. The RDC data is stashed in the postponed state which is attached to all of the different outputs that comprise a page (the segments, the HTML, and the dynamic RSC data). However, when deployed to targets like Vercel, the revalidation was incorrectly bypassing the cache for the RSC entry, because it thought that it was a resume. This led to a drift in cached values, because the revalidation would cause the main RSC entries RDC data to contain a different value than what was used for the segment prefetches & HTML ISR entry. Fixes NAR-493 Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
Eli Oshinsky authored
<!-- 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 # --> Fixes #85520 When there is an active context from a custom server, the handleRequest span is not marked as a root span. As a result next.js does not track any root span attributes on the handleRequest span. Because the custom server does not know what route was matched by next and next is not tracking the route that matched this makes observability very challenging for users of a custom server. This PR changes the isRootSpan logic to treat the handleRequest span as a root span if there is not already a nextjs root span for the request instead of whether there is any active span. --------- Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Jiachi Liu authored
-
Benjamin Woodruff authored
@timneutkens pointed out that this test was sometimes flaky with the lockfile: https://vercel.slack.com/archives/C07UCHRBWGK/p1762267195472319 I wasn't able to reproduce this locally, but this test looked like it was in generally rough shape, and the `integration` test directory lacks test isolation, so this at least ports it to the modern framework. If nothing else, the test isolation might help.
-