Node.js 18.17 or newer is required
Action requiredOlder Node.js runtimes are unsupported.
Migration
Update local, CI and hosting runtimes before building.
Official sources
Compare Next.js versions and see exactly what changes, what requires action, and what you can start using.
UpgradePath detects relevant tools and selects them automatically.
Select the tools in your project to include relevant dependency updates in this guide.
Older Node.js runtimes are unsupported.
Update local, CI and hosting runtimes before building.
Static export is configured through output.
// build: next build && next export
module.exports = {};// build: next build
module.exports = {
output: 'export',
};Set output: 'export' in next.config.js and run next build. Check dynamic routes and server-only features.
Use the built-in font module.
import { Roboto } from '@next/font/google';
const font = Roboto({ weight: '400', subsets: ['latin'] });import { Roboto } from 'next/font/google';
const font = Roboto({ weight: '400', subsets: ['latin'] });Replace @next/font imports with next/font; run npx @next/codemod@latest built-in-next-font .
The next/server import is replaced.
import { ImageResponse } from 'next/server';
export async function GET() {
return new ImageResponse(<div>UpgradePath</div>);
}import { ImageResponse } from 'next/og';
export async function GET() {
return new ImageResponse(<div>UpgradePath</div>);
}Import ImageResponse from next/og and verify generated social images.