experimental (next.config)

Enables opt-in experimental Next.js features that may change.

Since Varies by feature (Next 13–15) Spec ↗

Syntax

experimental: { ...flags }

Parameters

NameTypeRequiredDescription
experimental object No Flags such as `ppr`, `dynamicIO`, `useCache`, `typedRoutes`, `serverActions`, `staleTimes`, `optimizePackageImports`.

Returns

NextConfig — Toggles experimental behavior.

Examples

const nextConfig = {
  experimental: {
    typedRoutes: true,
    optimizePackageImports: ['lucide-react'],
  },
}
module.exports = nextConfig
// Partial Prerendering + dynamicIO (canary)
const nextConfig = {
  experimental: {
    ppr: 'incremental',
    dynamicIO: true,
    useCache: true,
  },
}
module.exports = nextConfig

Notes

These flags gate not-yet-stable features; APIs/behavior can change between minor/canary releases and some require the Next.js canary build (e.g. `dynamicIO`, `useCache`, full `ppr`). `typedRoutes` adds type-checked `href`s; `optimizePackageImports` tree-shakes large barrel imports. Check the docs for the current set per version.

See also