Upgrade Next.js with the official codemods
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.jsondependencies, verified with a realnpm install. - Runs
@next/codemodtransforms chosen from Next.js’s own release notes. - Validates with
npm run buildand 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.