- 02 Feb, 2026 11 commits
-
-
nextjs-bot authored
-
Hendrik Liebau authored
Follow-up to #89407. Disables Server Function logging for `'use cache'` functions called from the client. The logging output for these Server Functions needs more work to be useful. Currently it shows internal details like `$$RSC_SERVER_CACHE_0` instead of the actual function name, as well as the encoded bound args promise.
-
JJ Kasper authored
Partial revert of https://github.com/vercel/next.js/pull/89269 the additional tracing is still necessary for webpack so this re-adds that and removes the silent failing to register require-hook. E2E deploy tests run https://github.com/vercel/next.js/actions/runs/21599777917
-
Hendrik Liebau authored
Restores Server Function logging to be enabled by default during development, as originally implemented in #88277. The change to opt-in in #89321 was overly conservative. The implicit default in #88277 was an intentional design decision. Users can still opt out via `next.config.js`: ```js module.exports = { logging: { serverFunctions: false, }, } ``` For `'use cache'` Server Functions called from the client, the logging still needs more work. We'll disable it for those in a follow-up PR rather than gating the entire feature. Also fixes a pre-existing error where `'verbose'` from the deprecated `experimental.browserDebugInfoInTerminal` config wasn't properly normalized to `logging.browserToTerminal`. This was now surfaced because the default `logging` value object was not typed as `LoggingConfig`. <!-- 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 # --> -
Jan Amann authored
I noticed the snippets were slightly broken when copying them to an app. <!-- 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>
-
Pavan Shinde authored
-
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.
-
Hendrik Liebau authored
Server Function logging (#88277) is now opt-in, consistent with how fetch logging works. This reduces noise in development logs by default. Additionally, for `'use cache'` Server Functions called from the client, the logging needs more work to be useful. Keeping it opt-in avoids exposing incomplete functionality by default. Server Function logging can be enabled in `next.config.js`: ```js module.exports = { logging: { serverFunctions: true, }, } ``` -
Niklas Mischkulnig authored
looking for a better name...
-
Tobias Koppers authored
### What? Move the error printing logic to turbo_tasks and add test cases for it
-
- 31 Jan, 2026 2 commits
-
-
nextjs-bot authored
-
Benjamin Woodruff authored
Reverts vercel/next.js#89099 Apparently this did not solve the user's memory leak issue: https://github.com/vercel/next.js/issues/89091#issuecomment-3826050800
-
- 30 Jan, 2026 27 commits
-
-
Suhaib authored
## What? This PR adds support for detecting `@typescript/native-preview` as an alternative TypeScript compiler. When installed, Next.js will no longer automatically install the `typescript` package. ## Why? Fixes #88580 Users who want to use `@typescript/native-preview` (a Go-based native TypeScript compiler) should not be forced to also install the JavaScript-based `typescript` package. This is especially relevant for projects using `next.config.ts` where TypeScript support is provided by Node.js native TS or SWC. ## How? 1. Added `hasNativeTypeScriptPreview()` function to detect if `@typescript/native-preview` is installed 2. Modified the dependency check logic in `verifyTypeScriptSetup()` to skip auto-installing `typescript` when the native preview is present 3. Added an informative log message to notify users that some TypeScript features (like type checking during build) require the standard `typescript` package 4. Added e2e test to verify the behavior ## Test Plan - Added new e2e test at `test/e2e/app-dir/typescript-native-preview/` - The test verifies: - Detection message is shown - `typescript` is not auto-installed - The app still works (SWC/Turbopack handles compilation)
-
Benjamin Woodruff authored
Disclaimer: This PR is entirely claude+opencode generated. - Crate name said `next-swc-napi`, which was confusing, because this has a lot more than swc bindings nowdays. - The crate name didn't match the directory name, which often confused agents. This does not change the npm package name, as that would likely have a much larger blast radius, and could break more things, to a point where it may not be worth it.
-
nextjs-bot authored
-
Hendrik Liebau authored
[flakiness metric](https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40git.repository.id%3A%22github.com%2Fvercel%2Fnext.js%22%20%40test.name%3A%22browser-log-forwarding%20verbose%20level%20should%20forward%20all%20logs%20to%20terminal%22%20%40test.type%3A%22nextjs%22%20%40test.status%3Afail&agg_m=count&agg_m_source=base&agg_t=count&fromUser=false&index=citest&start=1769207121512&end=1769811921512&paused=false) The test frequently failed because it snapshot-asserted on the forwarded browser logs before the final debug message was forwarded. This is because the initial assertion inside the `retry` block would pass because it falsely matched the debug message inside the error code frame (line 11): ``` [browser] browser error: this is an error message at Page.useEffect (app/page.tsx:10:13) 8 | console.info('browser info: this is an info message') 9 | console.warn('browser warn: this is a warning message') > 10 | console.error('browser error: this is an error message') | ^ 11 | console.debug('browser debug: this is a debug message') 12 | }, []) 13 | (app/page.tsx:10:13) ``` By adding the `[browser] ` prefix to all expected log messages, we ensure that the test only passes when the actual log messages are forwarded, and not when they appear inside code frames. <!-- 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 # -->
-
Hendrik Liebau authored
The server actions transform, which handles the `'use cache'` directive, was not being applied to `node_modules` when imported from route handlers. This caused `'use cache'` functions from dependencies to fail with errors like `"cacheLife() can only be called inside a 'use cache' function"``. The issue was that the `AppRoute` context used `internal_custom_rules` for its foreign code module options, which did not include the server actions transform. This is inconsistent with `AppRSC` (App Router pages), which correctly uses `foreign_next_server_rules` that includes the transform. The fix extends `foreign_next_server_rules` with `internal_custom_rules` and uses it for the foreign code context in `AppRoute`, matching the pattern used by `AppRSC`.
-
nextjs-bot authored
-
Niklas Mischkulnig authored
`test/e2e/middleware-redirects` has 404s on the data route
-
JJ Kasper authored
This test is also very flakey so adds it to the manifest as well
-
nextjs-bot authored
-
Luke Sandberg authored
Improve consistency of how Flag typed fields are handled in the macro to more structurally prevent bugs like what was fixed in #89228 (#89255) # Fix inconsistencies in flag handling ## What? This PR refactors the task flags bitfield implementation to properly separate flags by category (meta vs data) during serialization and deserialization. It also regularizes the way accessors are generated to try to prevent future bugs like what was fixed in #89228
-
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Rspack.
-
Vercel Release Bot authored
This auto-generated PR updates the development integration test manifest used when testing Rspack.
-
Neha Prasad authored
- What? Fixes zlib memory leak in Node.js 24 when requests are aborted. - Why? Compression streams weren't cleaned up on abort, causing memory to accumulate. - How? Destroy the response on request abort/close to clean up compression streams. Closes NEXT- fixes: #89091
-
nextjs-bot authored
-
Andrew Clark authored
## Summary - Adds `experimental.varyParams` feature flag (defaults to `false`) - When disabled, the client skips vary params rekeying and treats params as unknown - Allows internal rollout with easy revert if regressions occur during dogfooding The flag only gates the client-side rekeying logic in `cache.ts`. Server-side param tracking continues regardless. ## Test plan - Enabled the flag in the vary-params and optimistic-routing test fixtures
-
Tobias Koppers authored
### What? This PR adds support for the `type` option in Turbopack rules, enabling users to set the module type directly without requiring a custom loader. This mirrors webpack's [`type`](https://webpack.js.org/configuration/module/#ruletype) option (e.g., `type: 'asset/resource'`). Users can now configure how files are processed by setting the module type directly: ```js // next.config.js module.exports = { turbopack: { rules: { '*.svg': { type: 'asset', }, }, }, } ``` When using type: 'asset', importing the file returns its URL: ``` import svgUrl from './icon.svg' export default function Page() { return <img src={svgUrl} alt="Icon" /> } ``` More types are available. See docs
-
Tobias Koppers authored
### What? * Convert it to a markdown table * Show counts for all meta items * Show size of output
-
JJ Kasper authored
This updates to remove extra tracing that was being done in `build-complete` for deployment adapters to allow importing internal `node-environment` modules. Instead this exposes `next/setup-node-env` to adapters outputs that can be used instead and are traced through our normal bundling/tracing flow.
-
nextjs-bot authored
-
Niklas Mischkulnig authored
Closes PACK-6537 When a deployment id is available, don't put the data routes at `_next/data/<BUILDID>/page.json`, but at `_next/data/page.json`. Deployment skew (forcing a MPA nav instead of a SPA nav if a deployment happened inbetween) is handled by comparing a header on the client side. If you use `output:export` and set `config.deploymentId` (i.e. enable skew protection) you are still expected to set these headers. --- - [x] Find the right place where the header should be added for prerendered static RSC responses (route manifest)
-
Sebastian "Sebbie" Silbermann authored
-
Jiachi Liu authored
-
nextjs-bot authored
-
Andrew Clark authored
During prerendering, track which route params each segment accesses. Params that are NOT accessed can be omitted from the client router's cache key for that segment, allowing it to be shared across multiple pages and reducing the number of prefetch requests. For example, if a page at /shop/[category]/[itemId] only accesses `category` but not `itemId`, navigating between /shop/electronics/phone and /shop/electronics/tablet can reuse the same cached page segment, since only `category` affects its output. Most of the client-side changes were already implemented in previous PRs; the core mechanism was already being used for omitting search params from the cache keys of static segments. This generalizes the mechanism for all params. So this PR is primarily about adding per-param tracking on the server and wiring up the logic to send the params to the client. Each segment's CacheNodeSeedData contains its own VaryParamsThenable that resolves to a Set<string> of accessed param names. The thenable is a mutable tracker during render that accumulates param accesses, then resolves when rendering completes. The response also includes an `h` field for head vary params, which tracks params accessed by generateMetadata/generateViewport separately from segment body access. The trickiest part of this implementation is the timing. The vary params thenables represent metadata about the response, but they're also part of the response itself - they're streamed alongside the segment data. We can't know which params were accessed until rendering completes, but we need to resolve all thenables before aborting the stream, or else the client would block waiting for data that will never arrive. We address this on both sides. On the server, we resolve all thenables immediately before aborting. On the client, we read vary params synchronously using a React Flight optimization: calling thenable.then(noop) forces Flight to transition from 'resolved_model' to 'fulfilled' without scheduling a microtask. If the thenable still isn't fulfilled after this, we fall back to null (unknown) rather than blocking. This ensures the client never suspends on these thenables, providing a safe fallback if something goes wrong with server timing. A key distinction is null vs empty Set. An empty Set means the segment accesses no params and can be shared across all param values - this is the case for client components (when Cache Components is enabled), segments without user code, etc. A null value means tracking failed - either because it's not wired up yet (like runtime prefetches), or due to some edge case where the thenables weren't resolved in time. For segments where we know upfront that no params will be accessed, we use a singleton emptyVaryParamsTracker that's already resolved. This ensures these segments resolve correctly even if other tracking fails. In the future, we'll likely optimize the response format by sending a bitmask instead of a Set of param names. But this is mostly just an optimization — sending the Set doesn't expose anything new since the param names are already embedded in the route tree (although that's also something we could obfuscate in the future). This does not yet implement vary param tracking during runtime prefetches - the abort timing needs additional coordination. Deferred to a separate PR.
-
Tobias Koppers authored
### What? Stop rules when module type is set. Apply ecmascript transforms before module type is set. (no more errors when trying to apply a transform on non-ecmascript type) Fix ordering of transform apply. Reorder module rules to match previous order. They are applied in order now.
-
Deni Mintsaev authored
-
Sebastian "Sebbie" Silbermann authored
-