How to upgrade to version 15
Upgrade your Next.js Application from Version 14 to 15.
Upgrading from 14 to 15
To update to Next.js version 15, you can use the upgrade codemod:
If you prefer to do it manually, ensure that you're installing the latest Next & React versions:
Good to know:
- If you see a peer dependencies warning, you may need to update
reactandreact-domto the suggested versions, or use the--forceor--legacy-peer-depsflag to ignore the warning. This won't be necessary once both Next.js 15 and React 19 are stable.
React 19
- The Pages Router supports both React 18 and React 19, so upgrading
reactandreact-domto 19 is optional.
useFormStatehas been replaced byuseActionState. TheuseFormStatehook is still available in React 19, but it is deprecated and will be removed in a future release.useActionStateis recommended and includes additional properties like reading thependingstate directly. Learn more.useFormStatusnow includes additional keys likedata,method, andaction. If you are not using React 19, only thependingkey is available. Learn more.- Read more in the React 19 upgrade guide.
Good to know: If you are using TypeScript, ensure you also upgrade @types/react and @types/react-dom to their latest versions.
next/font
The @next/font package has been removed in favor of the built-in next/font. A codemod is available to safely and automatically rename your imports.
bundlePagesRouterDependencies
experimental.bundlePagesExternals is now stable and renamed to bundlePagesRouterDependencies.
serverExternalPackages
experimental.serverComponentsExternalPackages is now stable and renamed to serverExternalPackages.
Speed Insights
Auto instrumentation for Speed Insights was removed in Next.js 15.
To continue using Speed Insights, follow the Vercel Speed Insights Quickstart guide.
NextRequest Geolocation
The geo and ip properties on NextRequest have been removed as these values are provided by your hosting provider. A codemod is available to automate this migration.
If you are using Vercel, you can alternatively use the geolocation and ipAddress functions from @vercel/functions instead:
Troubleshooting
Installation fails after upgrading to React 19
- If another package's peer dependencies reject React 19, revert
react,react-dom, their types, andreact-is(if present) to the previous versions, provided the target Next.js version and router support them. - Restore or remove React type overrides or resolutions added by the upgrade in
package.jsonorpnpm-workspace.yaml. - If installation interrupted the upgrade command, retry the same exact target with
--skip-react-upgradeto preserve the repaired dependencies. If Next.js already matches the target, install dependencies and run any skipped codemods individually. Run the app's checks.
Installation fails after upgrading to ESLint 9
- If another package's peer dependencies reject ESLint 9, restore the previous compatible versions of
eslint,eslint-config-next, and@next/eslint-plugin-next(if present), along with the previous lint configuration. - If installation interrupted the upgrade command, retry the same exact target with
--skip-eslint-upgradeto preserve the repaired dependency. If Next.js already matches the target, install dependencies and run any skipped codemods individually. Complete any required lint migration manually, then run the app's lint checks.
Review migration checklist
After applying the changes relevant to your app, review these action items before you consider the migration complete:
- React dependencies and types meet the React 19 requirements for the app's router.
- Font imports use
next/fontinstead of@next/font. - Existing
bundlePagesExternalsandserverComponentsExternalPackagessettings use their documented stable names while preserving package configuration. -
NextRequestgeoandipconsumers use an appropriate source for the actual hosting provider. - Apps that relied on automatic Speed Insights instrumentation have an explicit integration if they still need it.
- The app's supported checks and affected runtime behavior pass. Remaining required failures keep the migration incomplete.