Nuxt 4 introduces several new features and improvements, including performance and API consistency improvements.

Codemod supports a mostly automated Nuxt 4 upgrade experience. This page provides tips and resources you may need for a successful migration.

Getting started

Migration Steps

1

Opt in to Nuxt 4

  1. Upgrade to the latest version of Nuxt:
    npx nuxi upgrade
    
  2. Set compatibilityVersion to match Nuxt 4 behavior:
    nuxt.config.ts
    export default defineNuxtConfig({
    future: {
        compatibilityVersion: 4,
    },
    })
    

For more info, please refer to opting in to Nuxt 4.

2

Run migration codemods

npx codemod@latest nuxt/4/migration-recipe

The recipe includes the following codemods:

For a list of all available codemods, see Codemod Registry.