---
title: How to upgrade to version 15
description: Upgrade your Next.js Application from Version 14 to 15.
url: "https://nextjs.org/docs/pages/guides/upgrading/version-15"
docs_index: /docs/pages/llms.txt
lastUpdated: 2026-10-15
navTitle: "Version 15"
prerequisites:
  - "Guides: /docs/pages/guides"
  - "Upgrading: /docs/pages/guides/upgrading"
---

> For an index of all documentation, see [/docs/pages/llms.txt](/docs/pages/llms.txt).

## Upgrading from 14 to 15

To update to Next.js version 15, you can use the `upgrade` codemod:

```bash
pnpm dlx @next/codemod@canary upgrade latest
```

```bash
npx @next/codemod@canary upgrade latest
```

```bash
yarn dlx @next/codemod@canary upgrade latest
```

```bash
bunx @next/codemod@canary upgrade latest
```

If you prefer to do it manually, ensure that you're installing the latest Next & React versions:

```bash
pnpm add next@latest react@latest react-dom@latest eslint-config-next@latest
```

```bash
npm install next@latest react@latest react-dom@latest eslint-config-next@latest
```

```bash
yarn add next@latest react@latest react-dom@latest eslint-config-next@latest
```

```bash
bun add next@latest react@latest react-dom@latest eslint-config-next@latest
```

> **Good to know:**
>
> - If you see a peer dependencies warning, you may need to update `react` and `react-dom` to the suggested versions, or use the `--force` or `--legacy-peer-deps` flag 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 `react` and `react-dom` to 19 is optional.

- `useFormState` has been replaced by `useActionState`. The `useFormState` hook is still available in React 19, but it is deprecated and will be removed in a future release. `useActionState` is recommended and includes additional properties like reading the `pending` state directly. [Learn more](https://react.dev/reference/react/useActionState).

- `useFormStatus` now includes additional keys like `data`, `method`, and `action`. If you are not using React 19, only the `pending` key is available. [Learn more](https://react.dev/reference/react-dom/hooks/useFormStatus).

- Read more in the [React 19 upgrade guide](https://react.dev/blog/2024/04/25/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`](/docs/app/api-reference/components/font). A [codemod is available](/docs/app/guides/upgrading/codemods#built-in-next-font) to safely and automatically rename your imports.

```js title="app/layout.js"
// Before
import { Inter } from '@next/font/google'

// After
import { Inter } from 'next/font/google'
```

## bundlePagesRouterDependencies

`experimental.bundlePagesExternals` is now stable and renamed to `bundlePagesRouterDependencies`.

```js title="next.config.js"
/** @type {import('next').NextConfig} */
const nextConfig = {
  // Before
  experimental: {
    bundlePagesExternals: true,
  },

  // After
  bundlePagesRouterDependencies: true,
}

module.exports = nextConfig
```

## serverExternalPackages

`experimental.serverComponentsExternalPackages` is now stable and renamed to `serverExternalPackages`.

```js title="next.config.js"
/** @type {import('next').NextConfig} */
const nextConfig = {
  // Before
  experimental: {
    serverComponentsExternalPackages: ['package-name'],
  },

  // After
  serverExternalPackages: ['package-name'],
}

module.exports = nextConfig
```

## Speed Insights

Auto instrumentation for Speed Insights was removed in Next.js 15.

To continue using Speed Insights, follow the [Vercel Speed Insights Quickstart](https://vercel.com/docs/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](/docs/app/guides/upgrading/codemods#150) is available to automate this migration.

If you are using Vercel, you can alternatively use the `geolocation` and `ipAddress` functions from [`@vercel/functions`](https://vercel.com/docs/functions/functions-api-reference/vercel-functions-package) instead:

```ts title="middleware.ts"
import { geolocation } from '@vercel/functions'
import type { NextRequest } from 'next/server'

export function middleware(request: NextRequest) {
  const { city } = geolocation(request)

  // ...
}
```

```ts title="middleware.ts"
import { ipAddress } from '@vercel/functions'
import type { NextRequest } from 'next/server'

export function middleware(request: NextRequest) {
  const ip = ipAddress(request)

  // ...
}
```

## Troubleshooting

### Installation fails after upgrading to React 19

- [ ] If another package's peer dependencies reject React 19, revert `react`, `react-dom`, their types, and `react-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.json` or `pnpm-workspace.yaml`.
- [ ] If installation interrupted the upgrade command, retry the same exact target with `--skip-react-upgrade` to 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-upgrade` to 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/font` instead of `@next/font`.
- [ ] Existing `bundlePagesExternals` and `serverComponentsExternalPackages` settings use their documented stable names while preserving package configuration.
- [ ] `NextRequest` `geo` and `ip` consumers 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.

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/docs/pages/llms.txt](/docs/pages/llms.txt)