Commit Graph

3801 Commits

Author SHA1 Message Date
Joseph 30dbf5ca75 docs: inline-css dev-action oriented (#89064)
Closes:
https://linear.app/vercel/issue/DOC-5722/inlinecss-unclear-large-bundles-description

---------

Co-authored-by: Allen Zhou <46854522+allenzhou101@users.noreply.github.com>
2026-02-13 11:45:33 +01:00
Joseph 02f2183d6a docs: adapterPath amends (#89930)
- use experimental versioning
- fix spacing for graphs
- spacing in [!NOTE]
2026-02-13 00:14:00 +00:00
Luke Sandberg 462b116ad3 Add a better error message for when turbopack cannot be loaded (#89633)
Add a more direct error message when next is running on a platform that turbopack doesn't support

document supported turbopack platforms

## Testing

To test i just set `NEXT_TEST_WASM=1` and ran a build

```
Error: Turbopack is not supported on this platform (darwin/arm64) because native bindings are not available. Only WebAssembly (WASM) bindings were loaded, and Turbopack requires native bindings.

To use Next.js on this platform, use Webpack instead:
  next dev --webpack

For more information, see: https://nextjs.org/docs/app/api-reference/turbopack#supported-platforms
    at ignore-listed frames

```
so it should work.  Messaging probably could be better (there is also a messge about not being able to set the lockfile) but this should be much better

Fixes #89305
2026-02-12 15:23:58 -08:00
Joseph 6627734522 docs: add deploymentId config and clarify encryption key for self-hosting (#89795)
Closes:
https://linear.app/vercel/issue/DOC-3953/encryption-keys-in-server-actions,
https://linear.app/vercel/issue/DOC-4975/next-server-actions-encryption-key-and-deploymentid

Closes https://github.com/vercel/next.js/discussions/88327

---------

Co-authored-by: Allen Zhou <46854522+allenzhou101@users.noreply.github.com>
2026-02-12 16:33:39 +01:00
freek-boon-greenberry 317b7d26df Update documentation to explain behavior in a Catch-all route (#89742)
<!-- 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 <sephxd1234@gmail.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2026-02-12 01:27:52 +01:00
Joseph c5c469926f docs: Move browserToTerminal into logging (#88901)
`browserToTerminal` stabilizes `browserDebugInfoInTerminal` - since it
lives under logging, let's remove the page and redirect to logging w/
fragment
2026-02-12 01:08:32 +01:00
Jimmy Lai 26306e7f16 After() docs requests API (#89837)
<!-- 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

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening
the PR.
- [x] 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?
Reworded the "With request APIs" section in the `after()` documentation.

### Why?
To clearly differentiate when `cookies()` and `headers()` can be used
inside `after()` in App Router pages (Server Components) versus Route
Handlers/Server Functions, addressing potential confusion and potential
runtime errors.

### How?
- Split the "With request APIs" section into two subsections: "In Route
Handlers and Server Functions" and "In Server Components (pages and
layouts)".
- Clarified that `cookies()`/`headers()` can be used directly in
`after()` for Route Handlers/Server Functions.
- Explained that `cookies()`/`headers()` *cannot* be used directly in
`after()` for Server Components due to partial prerendering/Cache
Components, and will throw a runtime error.
- Added a new code example demonstrating the correct pattern for Server
Components (reading request data *before* `after()` and passing it in).
- Corrected `await` syntax in existing Route Handler examples and
updated highlight line numbers.

Closes NEXT-
Fixes #

-->

---
[Slack
Thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1770819029314169?thread_ts=1770819029.314169&cid=C03KAR5DCKC)

<p><a
href="https://cursor.com/background-agent?bcId=bc-73042547-63d7-59b4-8f69-6e569308d2e9"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/agents?id=bc-73042547-63d7-59b4-8f69-6e569308d2e9"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a></p>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Joseph Chamochumbi <joseph.chamochumbi@vercel.com>
2026-02-12 00:29:16 +01:00
Joseph dc35817f9b docs: Papercuts Feb26 (#89484) 2026-02-11 21:07:26 +01:00
Joseph 18a6866676 docs: adapt lead to source path patterns (#89392)
Closes:
https://linear.app/vercel/issue/DOC-5826/feedback-documentation-i-think-there-is-some-severe-issue-with-this
2026-02-11 21:07:05 +01:00
JJ Kasper be25b83145 docs: update adapter docs for routing, handlers, and PPR (#89849)
## Summary
- update `experimental.adapterPath` docs to match current
`onBuildComplete` shape (`routing`, `buildId`, and latest output types)
- document `@next/routing` usage and note its experimental status
- add runtime entrypoint signature details for Node.js and Edge
(`handler(..., ctx)`)
- add a new PPR implementation section with markdown flow diagrams for
shell/resume stream composition and `requestMeta.onCacheEntryV2` cache
updates
- link to `nextjs/adapter-vercel` as the reference adapter example
2026-02-11 11:26:43 -08:00
Sebastian "Sebbie" Silbermann 34b5db7e83 Next CLI flags documentation (#89750)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Joseph Chamochumbi <joseph.chamochumbi@vercel.com>
2026-02-11 20:15:04 +01:00
Sebastian "Sebbie" Silbermann 61672d960b [docs] Add RedirectType usage example to permanentRedirect (#89833)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-02-11 15:07:45 +01:00
Vasiliy Vanchuk be56ce3ae8 docs: correct use term (#89438)
### What?

`use` is not a hook. It's highlighted in the doc

> Unlike React Hooks, use can be called within loops and conditional
statements like if. Like React Hooks, the function that calls use must
be a Component or Hook.


### Why?

It confuses consumers of Next.js and adds field provide misleading
proofs

### How?

Closes NEXT-
Fixes #

-->

---------

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
Co-authored-by: Joseph <sephxd1234@gmail.com>
2026-02-11 11:51:57 +01:00
Tobias Koppers adcac5dff1 Add turbopackIgnoreIssue config to suppress Turbopack warnings (#89682)
## What?

Adds the `experimental.turbopackIgnoreIssue` configuration option, which allows developers to suppress specific Turbopack warnings and errors based on file path, issue title, and/or description patterns. Filtered issues are hidden from both CLI output and the error overlay.

## Why?

Developers need a way to suppress noisy or expected warnings from Turbopack without disabling all warnings. This is useful for:
- Suppressing warnings from third-party code, generated files, or optional dependencies
- Reducing noise in development server output
- Hiding expected issues from the error overlay

## How?

### Configuration → Filtering Pipeline

1. **Config types** (`packages/next/src/server/config-shared.ts`, `config-schema.ts`):
   Each rule has a required `path` (glob string or RegExp) and optional `title`/`description` (exact string or RegExp). All specified fields must match (AND logic).

2. **RegExp serialization** (`packages/next/src/build/swc/index.ts`):
   Converts RegExp objects to `{ source, flags }` and glob strings to `{ type: 'glob', value }` for transfer to Rust.

3. **Rust deserialization** (`crates/next-core/src/next_config.rs`):
   `TurbopackIgnoreIssueRule`, `TurbopackIgnoreIssuePathPattern`, and `TurbopackIgnoreIssueTextPattern` types deserialize the config. A `turbopack_ignore_issue_rules()` turbo-tasks function converts them to `IgnoreIssue` rules with proper cache invalidation.

4. **Issue filtering** (`turbopack/crates/turbopack-core/src/issue/mod.rs`):
   `IssueFilter` is a turbo-tasks value that holds both severity filters and ignore rules. `IgnoreIssuePattern` supports exact string, glob, and regex matching (using `turbo-esregex` for ES-style regex). Matching issues are excluded before severity filtering.

5. **Integration** (`crates/next-api/src/project.rs`, `route.rs`, `empty.rs`):
   `Endpoint::project()` trait method provides access to the project config. `issue_filter()` builds the `IssueFilter` from project config. All issue collection points use the project's dynamic filter instead of the previous hardcoded `NEXT_ISSUE_FILTER`.

### Documentation

- New docs page: `docs/01-app/03-api-reference/05-config/01-next-config-js/turbopackIgnoreIssue.mdx`
- Updated Turbopack reference page with experimental options table: `docs/01-app/03-api-reference/08-turbopack.mdx`

### Testing

E2E test suite (`test/development/app-dir/turbopack-ignore-issue/`):
- **With config**: verifies matching warnings are suppressed from CLI output, matching errors are suppressed from the error overlay, and unrelated pages still compile normally
- **Without config**: verifies warnings and errors appear when no rules are defined

### Dependencies

- Added `turbo-esregex` for ES-style regex support in Rust

## Example

```js
// next.config.js
module.exports = {
  experimental: {
    turbopackIgnoreIssue: [
      { path: '**/vendor/**' },
      { path: 'app/**', title: 'Module not found' },
      { path: /generated\/.*\.ts/, description: /expected error/i },
    ],
  },
}
```
2026-02-11 08:26:58 +01:00
Abhishek Mardiya a7a017455b clarify unstable_cache replacement with use cache (#89435)
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: Joseph <joseph.chamochumbi@vercel.com>
2026-02-10 14:27:12 +01:00
Joseph d6d84be211 Remove more examples (#89709)
Removing examples that we are not using, or maintaining anymore.
2026-02-09 10:36:57 +00:00
Thomas Schrödinger 6dece1b365 Fix spelling in robots.mdx documentation (#89565)
This pull request makes minor documentation improvements to the
`robots.mdx` API reference, correcting a typo and clarifying the
description of `robots.js` route handler behavior.

- Documentation clarity and typo fixes:
* Corrected "Route Handlers" to "Route Handler" in the description of
`robots.js` and updated the explanation for clarity.
* Fixed the spelling of "customise" to "customize" for consistency with
American English.* Fixed spelling on some words of the robots.mdx
documentation:
- Handlers (plural) to Handler (singular)
- customise = customize

<!-- 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>
2026-02-06 10:20:05 +01:00
Pavan Shinde 2932b93253 docs: fix ISR guide link to res.revalidate (#89342)
<!--
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

• [x] Run pnpm prettier-fix to fix formatting issues before opening the
PR.
• [x] 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?

Fix a broken link in the ISR guide by switching to a site-absolute
/docs/... URL for the res.revalidate reference.

Why?

Without the leading /, the link can resolve as a relative path and break
depending on where it’s rendered.

How?

Update the ISR guide link target to a site-absolute
/docs/pages/guides/incremental-static-regeneration#on-demand-validation-with-resrevalidate.

Closes NEXT-
Fixes #
-->
2026-02-05 10:58:26 -08:00
Hendrik Liebau 469e513c5f Require explicit cacheLife on outer "use cache" when nesting short-lived caches (#89481)
This PR adds error handling for nested `"use cache"` where the inner
cache has a very short lifetime (zero `revalidate` or `expire` under 5
minutes) but the outer cache doesn't have an explicit `cacheLife()`
call.

Short-lived caches become "dynamic holes" that are excluded from
prerenders. When such a cache is nested inside another `"use cache"`
without an explicit `cacheLife`, the outer cache's lifetime would
silently become short too via
[propagation](https://nextjs.org/docs/app/api-reference/functions/cacheLife#nested-caching-behavior),
which can lead to unexpected behavior. To prevent this accidental
misconfiguration, Next.js now throws an error during prerendering,
requiring developers to explicitly declare their intent by adding
`cacheLife()` to the outer cache.

The implementation tracks whether `revalidate` and `expire` were
explicitly set via `hasExplicitRevalidate` and `hasExplicitExpire` flags
on the collected cache result. Errors are wrapped with
`wrapAsInvalidDynamicUsageError` to capture proper stack traces and
prevent userland try/catch from suppressing the build error.

Documentation has been updated with a new "Prerendering behavior"
section in the `cacheLife` API reference explaining how short-lived
caches become dynamic holes, and a "Nested short-lived caches"
subsection with examples showing how to fix the error.

closes NAR-761
2026-02-05 15:39:08 +00:00
Eric Rabinowitz 9e63d48794 docs: Fix syntax in proxy example code (#89395)
Fixes syntax for the code sample found on
https://nextjs.org/docs/pages/guides/multi-zones#routing-requests-using-proxy

---------

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2026-02-04 16:56:53 +01:00
Rhys Evans 446e1112a6 Fix indentation of types of tests in docs (#89409)
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2026-02-03 21:48:44 +01:00
Joseph 7437fed8bf Snippet multi package syntax (#89381)
<!-- 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?
Updated `docs/01-app/02-guides/package-bundling.mdx` to use
multi-package manager syntax for `next experimental-analyze` commands.

### Why?
To clarify the correct way to run `next experimental-analyze` with
different package managers (npx, yarn, pnpm), preventing common mistakes
like using `pnpx` instead of `pnpm next` for local binary execution.

### How?
Added `yarn next experimental-analyze` and `pnpm next
experimental-analyze` alternatives to the `npx next
experimental-analyze` code blocks in Step 1 and Step 4.

Closes NEXT-
Fixes #

-->

---
[Slack
Thread](https://vercel.slack.com/archives/C046HAU4H7F/p1770024460553639?thread_ts=1770024460.553639&cid=C046HAU4H7F)

<a
href="https://cursor.com/background-agent?bcId=bc-9b5e5ceb-78cf-5495-953e-53c04d01399c"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/agents?id=bc-9b5e5ceb-78cf-5495-953e-53c04d01399c"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-02-03 01:56:05 +01:00
Hendrik Liebau 286e243176 Restore default-enabled Server Function logging (#89407)
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 #

-->
2026-02-02 19:13:51 +01:00
Jan Amann 151b415c9d docs: Fix custom server code snippets (#89400)
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>
2026-02-02 19:12:59 +01:00
Pavan Shinde 0fca1fa062 docs: replace 'can not' with 'cannot' (#89354) 2026-02-02 17:07:02 +00:00
Hendrik Liebau 668dbd6d6d Make Server Function logging opt-in via logging.serverFunctions (#89321)
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,
  },
}
```
2026-02-02 14:58:53 +01:00
Tobias Koppers 99eae38f38 Turbopack: add rules.*.type config to allow changing the type of a module (#88788)
### 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
2026-01-30 19:02:13 +01:00
Deni Mintsaev 91bf04930d docs: Rename Error component to ErrorPage (#89284) 2026-01-30 13:43:57 +01:00
Tobias Koppers c6de62407a Turbopack: add support for contentType condition for webpack loaders (#89156)
### What?

Add `contentType` condition

This allows to apply webpack loaders to data urls

### Usage Example

```
module.exports = {
  turbopack: {
    rules: {
      '*': [
        {
          condition: { contentType: 'text/*' },  // glob match
          loaders: ['text-loader'],
          as: '*.js'
        },
        {
          condition: { contentType: /^image\// },  // regex match
          loaders: ['image-loader'],
          as: '*.js'
        },
      ],
    },
  },
}
```
2026-01-30 10:57:00 +01:00
Jiachi Liu f1a047fd80 IsolatedDevBuild flag removal (#89167)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: jiachi <jiachi@vercel.com>
2026-01-29 15:00:12 +01:00
Tobias Koppers 980975f793 Turbopack: add support for turbopackOptional: true (#89227)
### What?

* add support for turbopackOptional: true
* fix runtime code for unresolvable dynamic imports
* add documentation about magic comments
2026-01-29 10:13:21 +01:00
Sebastian "Sebbie" Silbermann 7a44309815 [docs] Always include unsafe-eval in dev Content-Security-Policy (#89163)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-01-28 22:25:58 +01:00
Eng Zer Jun 48ce83fa71 docs: fix code highlight in 07-fetching-data.mdx (#88727)
PR https://github.com/vercel/next.js/pull/82862 added an extra blank
line to the code snippet in
https://nextjs.org/docs/app/getting-started/fetching-data#parallel-data-fetching.

It should highlight the `Promise.all` line


![](https://github.com/user-attachments/assets/56adb793-601c-401f-81a5-78f1bd41fc2b)

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2026-01-27 16:22:45 +01:00
Delba de Oliveira cbea93f43f CC Guide: Fix filenames, reduce line breaks (#89065)
Follow-up
2026-01-27 14:04:39 +00:00
Tim Neutkens bf6784f78b Turbopack: Add postcss.config.ts support (#89049)
### What?

Adds support for TypeScript PostCSS configuration files in Turbopack.

### Why?

Users can write their PostCSS configuration in TypeScript for better
type safety and IDE support. This was already supported in webpack but
was missing in Turbopack.

### How?

Added the following TypeScript config file names to Turbopack's PostCSS
config detection:
- `postcss.config.ts`, `postcss.config.mts`, `postcss.config.cts`
- `.postcssrc.ts`, `.postcssrc.mts`, `.postcssrc.cts`
- `.config/postcssrc.ts`, `.config/postcssrc.mts`,
`.config/postcssrc.cts`

Also updated the Turbopack documentation to reflect the supported config
file extensions (`.js`, `.mjs`, `.cjs`, `.ts`, `.mts`, `.cts`).

### Testing

Added e2e tests that verify the TypeScript PostCSS config is actually
loaded and applied by using a custom plugin that transforms colors.
Tests cover:
- `postcss.config.ts`
- `postcss.config.mts`
- `postcss.config.cts`
- `.postcssrc.ts`
2026-01-27 11:59:35 +01:00
Delba de Oliveira d1cf4e6942 Cache Component Guide: Building public, _mostly_ static pages (#87248)
This PR adds a draft guide for building public pages with Cache
Components and PPR.

Part of a 3-guide series on:

- Building public pages with shared data
- Building page variants with route params (`generateStaticParams`)
- Build private pages with user-specific data

Todo: 

- [x] Link to glossary terms
- [x] Link to video
- [x] Link to demo + code
2026-01-26 17:19:46 +00:00
Joseph f2aa053c9f docs: revalidatePath w/ rewrites and trailing slash (#88956)
Follow up docs change for: https://github.com/vercel/next.js/pull/88732
and https://github.com/vercel/next.js/pull/88623
2026-01-26 12:19:00 +01:00
Joseph 0a6b9ba5b3 docs: improve clarity in cache components and server/client docs (#88946)
- Applying learnings from a recipe
- React.cache usage under a use cache scope
2026-01-26 09:51:39 +01:00
Hanzala Sohrab d8a0f6caa3 docs: Update Partytown URLs and package reference (#88928)
- Update Partytown documentation links from `builder.io` to `qwik.dev`.
- Update Partytown installation package reference in the guide.

<!-- 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

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening
the PR.
- [x] 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?
Updated Partytown documentation URLs and the installation package
reference in the `next/script` guide.

### Why?
Partytown documentation and packages have moved from `builder.io` to
`qwik.dev`. The old links were outdated, and the package reference
needed to be updated to `@qwik.dev/partytown` to ensure users install
the correct version.

### How?
Updated
[docs/01-app/02-guides/scripts.mdx](cci:7://file:///home/hanzala/Projects/personal/next.js/docs/01-app/02-guides/scripts.mdx:0:0-0:0)
to replace `partytown.builder.io` with `partytown.qwik.dev` and updated
the `npm install` instruction.

Closes NEXT-
Fixes #
2026-01-24 16:51:37 +01:00
Joseph 2b3d4f815b docs: Server functions rename (#86827)
Closes: https://github.com/vercel/next.js/issues/86781
2026-01-23 17:09:02 +01:00
Delba de Oliveira 599fc3f82a Docs: Add Next.js Glossary (#88811)
Add next.js glossary so we can reference concepts in guides without
having to re-explain them. Guides should be succint, like a skill :)

Closes: https://linear.app/vercel/issue/DOC-5574/nextjs-glossary

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2026-01-23 12:04:13 +00:00
Tobias Koppers 98fd3456fb Turbopack: query conditions in rules follow-ups (#88801)
Rebase of https://github.com/vercel/next.js/pull/87291
2026-01-22 15:30:59 +01:00
Jiachi Liu 37ac3974db stabilize browser log forward options (#88857) 2026-01-22 12:11:53 +01:00
Sebastian "Sebbie" Silbermann d56ed7bbca Allow inspecting server with next start --inspect (#88744) 2026-01-19 17:13:29 +01:00
Benjamin Woodruff f06909429d Turbopack: docs: condition.query will ship in 16.2.0, not 16.1.1 (#88663)
Follow up to https://github.com/vercel/next.js/pull/88644
2026-01-16 23:25:53 +01:00
Tobias Koppers 7e9d7cbd60 Turbopack: add support for matching loaders on resource queries (#88644)
### What?

Part of  PACK-1007

Adds `condition.query` support to Turbopack's loader rules, enabling loaders to match based on import query strings (e.g., `import './file?raw'`). This mirrors webpack's `resourceQuery` functionality.

The `query` condition accepts either a string (exact match) or RegExp (pattern match).

Adds tests and documentation for the new `condition.query` option.

### How to use

```js
// next.config.js
module.exports = {
  turbopack: {
    rules: {
      '*.txt': [
        // String: exact match
        { condition: { query: '?raw' }, loaders: ['raw-loader'], as: '*.js' },
        // RegExp: pattern match  
        { condition: { query: /\?transform/ }, loaders: ['transform-loader'], as: '*.js' },
      ],
    },
  },
}
```
2026-01-16 21:12:37 +01:00
Jiachi Liu 9fccecc301 doc: add details of mcp client integration (#88543)
add link to the mcp client configuration details section before the code
block of example

---------

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: timneutkens <tim@timneutkens.nl>
2026-01-16 09:44:08 +01:00
Steven 54476c9c64 fetch(next/image): reduce maximumResponseBody from 300MB to 50MB (#88588)
Based on our metrics, the P99.9 for a source image is 47 MB so we can
adjust the default setting to be much lower (by changing from from 300
MB to 50 MB) in favor of reducing memory.
2026-01-15 14:34:13 -05:00
Tim Neutkens 8d7682f196 docs: fix Pages Router fonts documentation showing App Router examples (#88326)
## Summary

Fixes #88291

The Pages Router fonts documentation was incorrectly showing App Router
examples (`app/layout.tsx`) which don't exist in Pages Router. This
confused users trying to use fonts with the Pages Router.

## Changes

Updated `docs/01-app/01-getting-started/13-fonts.mdx` to include proper
`<AppOnly>` and `<PagesOnly>` sections:

**For Pages Router users:**
- Added examples using `pages/_app.tsx` (Custom App) to wrap components
with font className
- Added examples using `pages/_document.tsx` (Custom Document) to apply
fonts to the `<html>` element

**For App Router users:**
- Wrapped existing `app/layout.tsx` examples in `<AppOnly>` sections

This follows the same pattern used in other shared documentation like
`docs/01-app/01-getting-started/11-css.mdx` which properly separates App
Router and Pages Router content.
2026-01-15 10:53:02 +01:00
Tim Neutkens 304940e987 docs: add useSearchParams and useParams documentation for Pages Router (#88429)
## Description

This PR adds dedicated documentation pages for `useSearchParams` and
`useParams` hooks in the Pages Router documentation.

### Changes

- Added
`docs/02-pages/04-api-reference/03-functions/use-search-params.mdx`
- Added `docs/02-pages/04-api-reference/03-functions/use-params.mdx`

### Why

Both `useSearchParams` and `useParams` from `next/navigation` work in
the Pages Router, but this was not well documented. The only mention was
a brief note in the App Router docs and a migration section in the Pages
Router `useRouter` docs.

### What's Documented

For both hooks:
- Basic usage with the fallback UI pattern for handling `null` during
pre-rendering
- Return values and behavior differences from App Router
- Usage with `getServerSideProps` (where params are immediately
available)
- Examples for sharing components between App Router and Pages Router

For `useParams` specifically:
- Comparison with `router.query` (which includes both dynamic params and
query string params)

### Related Test

The existing test at `test/e2e/app-dir/params-hooks-compat` validates
that these hooks work in both routers.
2026-01-14 16:15:51 +01:00