Next.js upgrades

Upgrade Next.js with the official codemods

Quick answer. UpgradePilot upgrades Next.js apps the same way as React apps, plus it runs the official @next/codemod transforms and detects whether your project uses the Pages Router or the App Router so the right steps apply.

The problem

Next.js majors change routing, caching and configuration defaults, so an upgrade is more than bumping a version.

Teams on the Pages Router also have to decide whether to migrate to the App Router — a separate decision from upgrading.

What UpgradePilot does for Next.js

  • Detects Next.js version and Pages Router vs App Router usage.
  • Upgrades package.json dependencies, verified with a real npm install.
  • Runs @next/codemod transforms chosen from Next.js’s own release notes.
  • Validates with npm run build and parses Jest/Vitest results.
  • Opens a pull request with the changes and notes.

What you still review by hand

UpgradePilot is built so nothing is hidden: these are the places a person should look before merging.

  • Caching and data-fetching behavior changes between majors.
  • Middleware, image, font and config changes called out in the release notes.
  • Hosting-platform settings (runtime, edge functions, environment variables).
  • Whether to migrate from Pages Router to App Router — upgrading doesn’t force it.

Common pitfalls

  • Run the production build, not just dev mode, before judging an upgrade.
  • Check that your hosting provider supports the target Next.js version before merging.

Documentation to review

Read the official notes for the versions you’re crossing alongside the pull request UpgradePilot produces.

Next.js upgrade FAQ

Does it migrate me from the Pages Router to the App Router?

No. It detects which router you use and upgrades accordingly. Moving to the App Router is a separate, deliberate migration.

Are the codemods the official ones?

Yes — the real @next/codemod CLI, with transforms matched to Next.js’s release notes.

Can it handle a monorepo?

Frontend detection looks at the repository structure; check the README for current monorepo support and contact us if yours is unusual.

Related stacks

React.NET + React/Next.jsAll documentation

Want a second pair of eyes on your upgrade?

Tell us your stack and current version. We’ll reply with what’s involved and whether the free app or Cloud fits.