Nuxt 4.0 is out: what changes and how to upgrade from Nuxt 3
On 15 July 2025 the Nuxt team released Nuxt 4.0. Unlike the jump from Nuxt 2 to Nuxt 3, this is not a rebuild but a stability-focused major release with a few deliberate breaking changes. If you run a Nuxt 3 project today, you do not have to act right away: according to the announcement, Nuxt 3 will receive maintenance updates until the end of January 2026. I still recommend reading the upgrade guide now and testing the upgrade in a separate branch. In this article I summarise what changes according to the announcement and the upgrade guide, and in which order I approach it.
Why is Nuxt 4 not a second Nuxt 3?
I moved a web application from Nuxt 2 to Nuxt 3 with my team, including a new component library and new state management. Nuxt 4 is set up differently. The team describes it as a stability-focused release that arrives after a year of real-world testing. According to the announcement, most of the breaking changes have been testable with a compatibility flag for over a year. In Nuxt 3 that flag was compatibilityVersion: 4 under future in nuxt.config. For most breaking changes there are also configuration options that bring back the old behaviour while you adjust.
The announcement names four focus areas: a cleaner project structure with the new app/ directory, reworked data fetching, better TypeScript support with separate projects per context, and a faster CLI.
What changes in the project structure?
The most visible change: application code lives in an app/ directory by default. The new default srcDir is app/, containing assets/, components/, composables/, layouts/, middleware/, pages/, plugins/ and utils/ as well as app.vue, app.config.ts and error.vue. The project root keeps nuxt.config.ts, content/, layers/, modules/, public/ and server/. The ~ alias now points to app/.
The guide gives two reasons. File watchers no longer have to scan node_modules/ and .git/, which could significantly delay startup on non-Mac operating systems. And because server/ no longer sits in the same folder as the rest of the app, the IDE can tell client and server code apart more reliably.
Moving is not required. If Nuxt detects the old structure, for example a top-level pages/ directory, everything keeps working as before. To pin the old structure explicitly, the guide suggests:
export default defineNuxtConfig({
srcDir: '.',
dir: {
app: 'app'
}
})
What changes in data fetching?
In my view this is the part that needs the most attention. useAsyncData and useFetch have been reorganised:
- All calls with the same key share the same
data,errorandstatusrefs. Calls with the same explicit key must therefore not have conflicting options such asdeep,transform,pick,getCachedDataordefault. - Keys can be reactive: a
computed, arefor a getter function. When the key changes, Nuxt fetches the data again. - When the last component using a piece of data is unmounted, Nuxt removes that data.
datais now ashallowRef. If your code changes a property inside the data, that no longer triggers reactivity. If you need it, setdeep: trueper call.dataanderrornow default toundefinedinstead ofnull. Checks fornullneed updating.pendingis onlytruewhilestatusis alsopending. Withimmediate: false,pendingstaysfalseuntil the first request.
The guide suggests extracting calls that share a key and have custom options into their own composable. That matches what I already did during the Nuxt 3 migration: bundling data fetching in reusable composables instead of rewriting it in every component.
What changes for TypeScript?
Nuxt now generates separate TypeScript configurations for the app, the server, the shared/ folder and build-time code: .nuxt/tsconfig.app.json, .nuxt/tsconfig.server.json, .nuxt/tsconfig.shared.json and .nuxt/tsconfig.node.json. According to the guide, existing projects that extend .nuxt/tsconfig.json keep working as before. To get the improved type checking, you switch the root tsconfig.json to project references and run vue-tsc with -b. The announcement explicitly calls this the change most likely to cause surprises when upgrading, because the new setup may surface type issues that were hidden before.
There is also a stricter default: noUncheckedIndexedAccess is now true. The guide recommends fixing the new errors rather than reverting the option.
What else is gone?
- Nuxt 2 compatibility has been removed from
@nuxt/kit. According to the announcement, this mainly affects module authors. - The top-level
generateconfiguration no longer exists.generate.routesandgenerate.excludebecomenitro.prerender.routesandnitro.prerender.ignore. - The global
window.__NUXT__object is removed after hydration. The data is available throughuseNuxtApp().payload. - Unhead, which generates the
<head>tags, has moved to version 2. The propsvmid,hid,childrenandbodyare gone.
How do I approach the upgrade?
The announcement describes three steps, and that is how I would approach it:
- Update Nuxt. The recommended command is
npx nuxt upgrade --dedupe. It also deduplicates the lockfile and helps pull in updates to dependencies Nuxt relies on. - Optionally use the codemods. Together with Codemod, the Nuxt team built a recipe that automates many, though not all, migration steps:
npx codemod@latest nuxt/4/migration-recipe. You can deselect individual codemods during the run. - Test and adjust. Run your tests, check the build and read the upgrade guide for the cases that occur in your project.
Before step 1 it is worth checking the modules you use. The announcement points out that a few modules might need further updates for full Nuxt 4 compatibility. Whatever is missing there sets the schedule.
How long will Nuxt 3 be maintained?
According to the announcement, Nuxt 3 will receive maintenance updates, meaning bug fixes and backports of features from Nuxt 4, until the end of January 2026. Looking ahead, the team plans to release Nuxt 5 on the sooner side, with Nitro v3 and h3 v2. According to the roadmap, Nuxt 4 bundles the features that were previously behind compatibilityVersion: 4, and Nuxt 5 is meant to follow shortly after. As a general rule, the Nuxt team commits to supporting each major version for at least six months after the release of the next one.
What I take away
- Nuxt 4 is a manageable upgrade. For most changes there is a way back while you adjust.
- Data fetching deserves the most attention: shared keys,
shallowRef,undefinedinstead ofnulland the newpending. - The new TypeScript setup may surface errors that were hidden before. That is work, but useful work.
- Check modules first, then upgrade, then codemods and tests.
- There is time until the end of January 2026. It is best spent on a clean upgrade, not on postponing it.