Unverified Commit 2af3c42a authored by Aurora Scharff's avatar Aurora Scharff Committed by GitHub

docs: clarify Cache Components runtime config (#99820)

## Summary

Clarify that Cache Components does not support the runtime route segment
config, including an explicit Node.js runtime value.

Document the required removal in the migration guide, runtime API
reference, and cacheComponents reference so the guidance matches the
build diagnostic.

## Verification

- Confirmed the existing runtime-edge migration anchor remains
unchanged.
- Not run: runtime tests (documentation-only change).

<!-- NEXT_JS_LLM -->
parent f173bcc8
...@@ -941,7 +941,7 @@ See [`generateMetadata` with Cache Components](/docs/app/api-reference/functions ...@@ -941,7 +941,7 @@ See [`generateMetadata` with Cache Components](/docs/app/api-reference/functions
## `runtime = 'edge'` ## `runtime = 'edge'`
**Not supported.** Cache Components requires the Node.js runtime. Switch to the Node.js runtime (the default) by removing the [deprecated](/docs/messages/edge-runtime-deprecated) `runtime = 'edge'` export. If you need edge behavior for specific routes, use [Proxy](/docs/app/api-reference/file-conventions/proxy) instead. **Remove the `runtime` export.** Cache Components requires the Node.js runtime, which is the default, and does not support the [`runtime` route segment config](/docs/app/api-reference/file-conventions/route-segment-config/runtime). Remove the export even when it is set to `runtime = 'nodejs'`. If a route uses the [deprecated](/docs/messages/edge-runtime-deprecated) `runtime = 'edge'` export, remove it and use [Proxy](/docs/app/api-reference/file-conventions/proxy) when you need edge behavior.
## `experimental_ppr` ## `experimental_ppr`
......
...@@ -21,4 +21,5 @@ export const runtime = 'nodejs' ...@@ -21,4 +21,5 @@ export const runtime = 'nodejs'
> **Good to know**: > **Good to know**:
> >
> - The Edge Runtime is deprecated. Remove the `runtime` export from your route files. See [Edge Runtime Deprecated](/docs/messages/edge-runtime-deprecated). > - The Edge Runtime is deprecated. Remove the `runtime` export from your route files. See [Edge Runtime Deprecated](/docs/messages/edge-runtime-deprecated).
> - When [Cache Components](/docs/app/api-reference/config/next-config-js/cacheComponents) is enabled, remove the `runtime` export, including `runtime = 'nodejs'`. Cache Components uses the default Node.js runtime and does not support the `runtime` route segment config. See [Migrating to Cache Components](/docs/app/guides/migrating-to-cache-components#runtime--edge).
> - This option cannot be used in [Proxy](/docs/app/api-reference/file-conventions/proxy). > - This option cannot be used in [Proxy](/docs/app/api-reference/file-conventions/proxy).
...@@ -28,7 +28,7 @@ export default nextConfig ...@@ -28,7 +28,7 @@ export default nextConfig
Set `partialPrefetching` explicitly. Leaving it unset logs a warning, because the first release of Cache Components did not include Partial Prefetching. Set it to `false` only while [migrating an app that adopted Cache Components before Partial Prefetching](/docs/app/guides/adopting-partial-prefetching). Both features will be enabled everywhere in the next major release, and the options will be removed. Set `partialPrefetching` explicitly. Leaving it unset logs a warning, because the first release of Cache Components did not include Partial Prefetching. Set it to `false` only while [migrating an app that adopted Cache Components before Partial Prefetching](/docs/app/guides/adopting-partial-prefetching). Both features will be enabled everywhere in the next major release, and the options will be removed.
> **Good to know**: Cache Components requires the Node.js runtime. Migrate any routes that set the deprecated `runtime = 'edge'` export, and note that other server-side JavaScript runtimes are not guaranteed to work. See [Migrating to Cache Components](/docs/app/guides/migrating-to-cache-components#runtime--edge). > **Good to know**: Cache Components requires the Node.js runtime and does not support the [`runtime` route segment config](/docs/app/api-reference/file-conventions/route-segment-config/runtime). Remove any `runtime` export, including `runtime = 'nodejs'` and the deprecated `runtime = 'edge'`. Other server-side JavaScript runtimes are not guaranteed to work. See [Migrating to Cache Components](/docs/app/guides/migrating-to-cache-components#runtime--edge).
When `cacheComponents` is enabled, you can use the following cache functions and configurations: When `cacheComponents` is enabled, you can use the following cache functions and configurations:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment