nuxt/nuxt (nuxt)
Compare Source
4.1.3 is a regularly scheduled patch release.
✅ Upgrading
Our recommendation for upgrading is to run:
npx nuxt upgrade --dedupe
This will deduplicate your lockfile as well, and help ensure that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
👉 Changelog
compare changes
🔥 Performance
- vite: Use rolldown's replace plugin when applicable (#33258)
🩹 Fixes
- kit: Add default values when adding type references in
prepare:types hook (#33239)
- nuxt: Augment app config in server context (#33287)
- nuxt: Make lazy component types compatible with
h (#33046)
- vite: Deduplicate inlined server style chunks (#33308)
- nuxt: Support
head option on useHead (#33318)
- nuxt: Do not relativise importmap if
cdnURL is set (#33333)
- nuxt: Resolve aliases in
imports.dirs (#33334)
- nuxt: Add missing element/vnode props for
<NuxtLink> (#33335)
- nuxt: Do not generate server placeholder components (#33345)
- nuxt: Dedupe generated component names (#33346)
- webpack: Test watch instance before closing it (0e5a0a5a0)
- nuxt: Correctly handle island rendering error (#33302)
- nuxt: Support
v-slot:fallback longform syntax in <DevOnly> (#33368)
- nuxt: Support
typeFrom when generating auto-import type templates (#33373)
- nuxt: Don't trigger scroll when changing trailing slash (#33358)
- nuxt: Add stubs for new scripts from
@nuxt/scripts (bed410d60)
- nuxt: Prevent duplicate execution on key change in
useAsyncData (#33325)
- nuxt: Make middleware
_path property configurable for HMR (#33379)
- nuxt: Handle non-immediate
useAsyncData with different key on ssr (#33341)
💅 Refactors
- nuxt: Improve implementation of error composables (#33234)
- nuxt: Resolve path of
typed-router.d.ts early for consistency (#33285)
- nuxt: Move server references to
nitro:prepare:types hook (#33286)
- nuxt: Place
filename into componentsIslandsTemplate definition (#33394)
- nuxt,vite: Use environment-api compatible plugins (#33403)
📖 Documentation
- Add
4.x prefix to all internal links (#33264)
- Fix more links (#33265)
- Update usage instructions for Windows users (#33284)
- Update app config paths to use app/app.config.ts (#33297)
- Remove d suffix in example (#33298)
- Move directory structure to top-level (#33299)
- Add information about
useFetch reactivity (#33317)
- Add more
4.x prefixes in urls (47ea684c7)
- Lint code samples within docs (#33271)
- Remove duplicated documentation from
nuxt.config page (b438d44e1)
- Remove docs for outdated asyncData configuration (3e4a999e6)
- Note
prepare command NODE_ENV behavior (#33330)
- Update
nuxt command pages (#33336)
🏡 Chore
✅ Tests
- nuxt: Set locale to en for nuxt-time tests (#33343)
- Double
gotoPath timeout in CI (f1e5a2d4c)
🤖 CI
- Add provenance action to check for downgrades in provenance (5ada6861e)
- Pass commit sha when triggering ecosystem ci (399df6bab)
❤️ Contributors
Compare Source
4.1.2 is a regularly scheduled patch release.
✅ Upgrading
Our recommendation for upgrading is to run:
npx nuxt upgrade --dedupe
This will deduplicate your lockfile as well, and help ensure that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
👉 Changelog
compare changes
🔥 Performance
- kit: Do not normalise templates in loop if
dst is present (#33200)
- nuxt: Remove watcher from
hydrate-when lazy hydration strategy (#33199)
- nuxt,schema: Normalise components + directories more efficiently (#33207)
- kit,nuxt: Reduce unnecessary iteration in nuxt code (#33212)
- nuxt: Skip running lazy hydration transform with filter (#33213)
🩹 Fixes
- schema: Add
pkg-types to dependencies (9fe2541ca)
- nuxt: Ignore errors when treeshaking composables within other composables (f99eac516)
- nuxt: Do not tree-shake composables within other composables (#33153)
- kit: Ensure module dependencies are typed correctly (4568e8451)
- nuxt: Prevent Infinity
backgroundSize in loading indicator (#33211)
- nuxt: Remove unused
enabled from components dir options (#32844)
- nuxt: Sync watch request in useAsyncData (#33192)
- nuxt: Move key imports logic after all modules run (#33214)
📖 Documentation
- Update reference to source dir (65712297a)
- Update language on bridge head migration (c9d986889)
- Update file path for pinia store (#33205)
- Add
app/ suffix to a few links (#33217)
🏡 Chore
✅ Tests
❤️ Contributors
Compare Source
v4.1.1 is a regularly scheduled patch release
✅ Upgrading
Our recommendation for upgrading is to run:
npx nuxt upgrade --dedupe
This will deduplicate your lockfile as well, and help ensure that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
👉 Changelog
compare changes
🩹 Fixes
- nuxt: Correct relative path of auto imported components (#33122)
- nuxt: Prefer accessing
globalThis over window (#33125)
- nuxt: Migrate to AST-aware tree-shaking + route injection (#33128)
- nuxt: Ignore #components import mapping inside packages that use it internally (#33049)
- vite: Remove explicit vite-node configuration of
deps.inline (#33133)
- nuxt: Include trace in dev-time
useRoute usage warning (#33039)
- kit: Improve DX by displaying module name when possible (#33137)
- nuxt: Print route middleware path in warning (#33136)
- nuxt: Include core auto-imports from
imports:sources in override warning (#33050)
- nuxt: Render relative importmap entry path if required (#33146)
📖 Documentation
- Add
-- to bun create command (5e661f0ca)
- Add
app/ prefix in lots of cases (#33117)
- Add JSDoc for
navigateTo (#21442)
🏡 Chore
🤖 CI
- Remove default discord reactions from thread (more noise than it's worth) (183913fe2)
- Rewrite release workflow in ts + support multiple tags (4469ead82)
- Pass correct flag (711037cda)
- Pass tag via env variable (fb83cd5ba)
- Drop
4x tags from releases (1cd8a6857)
❤️ Contributors
Compare Source
👀 Highlights
🔥 Build and Performance Improvements
🍫 Enhanced Chunk Stability
Build stability has been significantly improved with import maps (#33075). This prevents cascading hash changes that could invalidate large portions of your build when small changes are made:
<!-- Automatically injected import map -->
<script type="importmap">{"imports":{"#entry":"/_nuxt/DC5HVSK5.js"}}</script>
By default, JS chunks emitted in a Vite build are hashed, which means they can be cached immutably. However, this can cause a significant issue: a change to a single component can cause every hash to be invalidated, massively increasing the chance of 404s.
In short:
- a component is changed slightly - the hash of its JS chunk changes
- the page which uses the component has to be updated to reference the new file name
- the entry now has its hash changed because it dynamically imports the page
- every other file which imports the entry has its hash changed because the entry file name is changed
Obviously this wasn't optimal. With this new feature, the hash of (otherwise) unchanged files which import the entry won't be affected.
This feature is automatically enabled and helps maintain better cache efficiency in production. It does require native import map support, but Nuxt will automatically disable it if you have configured vite.build.target to include a browser that doesn't support import maps.
And of course you can disable it if needed:
export default defineNuxtConfig({
experimental: {
entryImportMap: false
}
})
🦀 Experimental Rolldown Support
Nuxt now includes experimental support for rolldown-vite (#31812), bringing Rust-powered bundling for potentially faster builds.
To try Rolldown in your Nuxt project, you need to override Vite with the rolldown-powered version since Vite is a dependency of Nuxt. Add the following to your package.json:
npm:
{
"overrides": {
"vite": "npm:rolldown-vite@latest"
}
}
pnpm:
{
"pnpm": {
"overrides": {
"vite": "npm:rolldown-vite@latest"
}
}
}
yarn:
{
"resolutions": {
"vite": "npm:rolldown-vite@latest"
}
}
bun:
{
"overrides": {
"vite": "npm:rolldown-vite@latest"
}
}
After adding the override, reinstall your dependencies. Nuxt will automatically detect when Rolldown is available and adjust its build configuration accordingly.
For more details on Rolldown integration, see the Vite Rolldown guide.
[!NOTE]
This is experimental and may have some limitations, but offers a glimpse into the future of high-performance bundling in Nuxt.
🧪 Improved Lazy Hydration
Lazy hydration macros now work without auto-imports (#33037), making them more reliable when component auto-discovery is disabled:
<script setup>
// Works even with components: false
const LazyComponent = defineLazyHydrationComponent(
'visible',
() => import('./MyComponent.vue')
)
</script>
This ensures that components that are not "discovered" through Nuxt (e.g., because components is set to false in the config) can still be used in lazy hydration macros.
📄 Enhanced Page Rules
If you have enabled experimental extraction of route rules, these are now exposed on a dedicated rules property on NuxtPage objects (#32897), making them more accessible to modules and improving the overall architecture:
// In your module
nuxt.hook('pages:extend', pages => {
pages.push({
path: '/api-docs',
rules: {
prerender: true,
cors: true,
headers: { 'Cache-Control': 's-maxage=31536000' }
}
})
})
The defineRouteRules function continues to work exactly as before, but now provides better integration possibilities for modules.
🚀 Module Development Enhancements
Module Dependencies and Integration
Modules can now specify dependencies and modify options for other modules (#33063). This enables better module integration and ensures proper setup order:
export default defineNuxtModule({
meta: {
name: 'my-module',
},
moduleDependencies: {
'some-module': {
// You can specify a version constraint for the module
version: '>=2',
// By default moduleDependencies will be added to the list of modules
// to be installed by Nuxt unless `optional` is set.
optional: true,
// Any configuration that should override `nuxt.options`.
overrides: {},
// Any configuration that should be set. It will override module defaults but
// will not override any configuration set in `nuxt.options`.
defaults: {}
}
},
setup (options, nuxt) {
// Your module setup logic
}
})
This replaces the deprecated installModule function and provides a more robust way to handle module dependencies with version constraints and configuration merging.
🪝 Module Lifecycle Hooks
Module authors now have access to two new lifecycle hooks: onInstall and onUpgrade (#32397). These hooks allow modules to perform additional setup steps when first installed or when upgraded to a new version:
export default defineNuxtModule({
meta: {
name: 'my-module',
version: '1.0.0',
},
onInstall(nuxt) {
// This will be run when the module is first installed
console.log('Setting up my-module for the first time!')
},
onUpgrade(inlineOptions, nuxt, previousVersion) {
// This will be run when the module is upgraded
console.log(`Upgrading my-module from v${previousVersion}`)
}
})
The hooks are only triggered when both name and version are provided in the module metadata. Nuxt uses the .nuxtrc file internally to track module versions and trigger the appropriate hooks. (If you haven't come across it before, the .nuxtrc file should be committed to version control.)
[!TIP]
This means module authors can begin implementing their own 'setup wizards' to provide a better experience when some setup is required after installing a module.
🙈 Enhanced File Resolution
The new ignore option for resolveFiles (#32858) allows module authors to exclude specific files based on glob patterns:
// Resolve all .vue files except test files
const files = await resolveFiles(srcDir, '**/*.vue', {
ignore: ['**/*.test.vue', '**/__tests__/**']
})
📂 Layer Directories Utility
A new getLayerDirectories utility (#33098) provides a clean interface for accessing layer directories without directly accessing private APIs:
import { getLayerDirectories } from '@​nuxt/kit'
const layerDirs = await getLayerDirectories(nuxt)
// Access key directories:
// layerDirs.app - /app/ by default
// layerDirs.appPages - /app/pages by default
// layerDirs.server - /server by default
// layerDirs.public - /public by default
✨ Developer Experience Improvements
🎱 Simplified Kit Utilities
Several kit utilities have been improved for better developer experience:
addServerImports now supports single imports (#32289):
// Before: required array
addServerImports([{ from: 'my-package', name: 'myUtility' }])
// Now: can pass directly
addServerImports({ from: 'my-package', name: 'myUtility' })
🔥 Performance Optimizations
This release includes several internal performance optimizations:
- Improved route rules cache management (#32877)
- Optimized app manifest watching (#32880)
- Better TypeScript processing for page metadata (#32920)
🐛 Notable Fixes
- Improved
useFetch hook typing (#32891)
- Better handling of TypeScript expressions in page metadata (#32902, #32914)
- Enhanced route matching and synchronization (#32899)
- Reduced verbosity of Vue server warnings in development (#33018)
- Better handling of relative time calculations in
<NuxtTime> (#32893)
✅ Upgrading
As usual, our recommendation for upgrading is to run:
npx nuxt upgrade --dedupe
This will refresh your lockfile and pull in all the latest dependencies that Nuxt relies on, especially from the unjs ecosystem.
👉 Changelog
compare changes
🚀 Enhancements
- kit: Add
ignore option to resolveFiles (#32858)
- kit: Add
onInstall and onUpgrade module hooks (#32397)
- nuxt,vite: Add experimental support for
rolldown-vite (#31812)
- nuxt: Extract
defineRouteRules to page rules property (#32897)
- nuxt,vite: Use importmap to increase chunk stability (#33075)
- nuxt: Lazy hydration macros without auto-imports (#33037)
- kit,nuxt,schema: Allow modules to specify dependencies (#33063)
- kit,nuxt: Add
getLayerDirectories util and refactor to use it (#33098)
🔥 Performance
- nuxt: Clear inline route rules cache when pages change (#32877)
- nuxt: Stop watching app manifest once a change has been detected (#32880)
🩹 Fixes
- nuxt: Handle
satisfies in page augmentation (#32902)
- nuxt: Type response in
useFetch hooks (#32891)
- nuxt: Add TS parenthesis and as expression for page meta extraction (#32914)
- nuxt: Use correct unit thresholds for relative time (#32893)
- nuxt: Handle uncached current build manifests (#32913)
- kit: Resolve directories in
resolvePath and normalize file extensions (#32857)
- schema,vite: Bump
requestTimeout + allow configuration (#32874)
- nuxt: Deep merge extracted route meta (#32887)
- nuxt: Do not expose app components until fully resolved (#32993)
- kit: Only exclude
node_modules/ if no custom srcDir (#32987)
- nuxt: Transform ts before page meta extraction (#32920)
- nuxt: Compare final matched routes when syncing
route object (#32899)
- nuxt: Make vue server warnings much less verbose in dev mode (#33018)
- schema: Allow disabling cssnano/autoprefixer postcss plugins (#33016)
- kit: Ensure local layers are prioritised alphabetically (#33030)
- kit,nuxt: Expose global types to vue compiler (#33026)
- deps: Bump devalue (#33072)
- nuxt: Support config type inference for
defineNuxtModule().with() (#33081)
- nuxt: Search for colliding names in route children (b58c139d2)
- nuxt: Delete
nuxtApp._runningTransition on resolve (#33025)
- nuxt: Add validation for nuxt island reviver key (#33069)
💅 Refactors
- nuxt: Simplify page segment parsing (#32901)
- nuxt: Remove unnecessary
async/await in afterEach (#32999)
- vite: Simplify inline chunk iteration (6f4da1b8c)
- kit,nuxt,ui-templates,vite: Address deprecations + improve regexp perf (#33093)
📖 Documentation
- Switch example to use vitest projects (#32863)
- Update testing
setupTimeout and add teardownTimeout (#32868)
- Update
webRoot to use new app directory (df7177bff)
- Add middleware to layers guide (6fc25ff79)
- Use
app/ directory in layer guide (eee55ea41)
- Add documentation for
--nightly command (#32907)
- Update package information in roadmap section (#32881)
- Add more info about nuxt spa loader element attributes (#32871)
- Update
features.inlineStyles default value (6ff3fbebb)
- Correct filename in example (#33000)
- Add more information about using
useRoute and accessing route in middleware (#33004)
- Avoid variable shadowing in locale example (#33031)
- Add documentation for module lifecycle hooks (#33115)
🏡 Chore
- config: Migrate renovate config (#32861)
- Remove stray test file (ca84285cc)
- Ignore webpagetest.org when scanning links (6c974f0be)
- Add
type: 'module' in playground (#33099)
✅ Tests
- Add failing test for link component duplication (#32792)
- Simplify module hook tests (#32950)
- Refactor stubbing of
import.meta.dev (#33023)
- Use
findWorkspaceDir rather than relative paths to repo root (a6dec5bd9)
- Improve router test for global transitions (5d783662c)
- Use
expect.poll (53fb61d5d)
- Use
expect.poll instead of expectWithPolling (357492ca7)
- Use
vi.waitUntil instead of custom retry logic (611e66a47)
🤖 CI
- Remove double set of tests for docs prs (6bc9dccf4)
- Add workflow for discord team discussion threads (bc656a24d)
- Fix some syntax issues with discord + github integrations (f5f01b8c1)
- Use token for adding issue to project (66afbe0a2)
- Use discord bot to create thread automatically (618a3cd40)
- Only use discord bot (bfd30d8ce)
- Update format of discord message (eb79a2f07)
- Try bolding entire line (c66124d7b)
- Oops (38644b933)
- Add delay after adding each reaction (ecb49019f)
- Use last lts node version for testing (e06e37d02)
- Try npm trusted publisher (85f1e05eb)
- Use npm trusted publisher for main releases (abf5d9e9f)
- Change wording (#32979)
- Add github ai moderator (#33077)
❤️ Contributors
Compare Source
4.0.3 is a regularly scheduled patch release.
👉 Changelog
compare changes
🔥 Performance
- kit: Get absolute path from
tinyglobby in resolveFiles (#32846)
🩹 Fixes
- nuxt: Do not throw undefined
error variable (#32807)
- vite: Include tsconfig references during
typeCheck (#32835)
- nuxt: Add sourcemap path transformation for client builds (#32313)
- nuxt: Add warning for lazy-hydration missing prefix (#32832)
- nuxt: Trigger call once navigation even when no suspense (#32827)
- webpack: Handle
null result from webpack call (84816d8a1)
- kit,nuxt: Use
reverseResolveAlias for better errors (#32853)
📖 Documentation
- Fix publicDir alias (#32841)
- Mention
bun.lock for lockfile (#32820)
- Add a section about augmenting types with TS project references (#32843)
- Improve explanation of global middleware (#32855)
🏡 Chore
- Update reproduction help text links (#32803)
- Update pnpm ignored build scripts (#32849)
- Improve internal types (052b98a35)
✅ Tests
- Move tests for
defineNuxtComponent out of e2e test (#32848)
🤖 CI
- Move nightly releases into different concurrency group (664041be7)
❤️ Contributors
Compare Source
4.0.2 is the next patch release.
Timetable: 28 July.
👉 Changelog
compare changes
🩹 Fixes
- nuxt: Provide typed slots for
<ClientOnly> and <DevOnly> (#32707)
- kit,nuxt,schema: Add trailing slash to some dir aliases (#32755)
- nuxt: Constrain global
defineAppConfig type (#32760)
- kit: Include module types in
app context (#32758)
- nuxt: Include source base url for remote islands (#32772)
- vite: Use vite node server to transform requests (#32791)
- kit: Use
mlly to parse module paths (#32386)
- nuxt: Execute all plugins after error rendering error.vue (#32744)
📖 Documentation
- Update Nuxt installation command to use
npm create nuxt@latest (#32726)
- Add AI-assisted contribution guidelines (#32725)
- Hydration best practice (#32746)
- Add example for module
.with() (#32757)
- Replace dead Vue Router docs links (#32779)
- Update nightly version references (#32776)
🏡 Chore
- Update reproduction links for bug-report template (#32722)
- Update
unbuild and use absolute path in dev stubs (#32759)
✅ Tests
🤖 CI
- Release
pkg.pr.new for main/3.x branches as well (b0f289550)
- Apply
3x tag to latest v3 release (5f6c27509)
❤️ Contributors
Compare Source
v4.0.1 is the first regularly scheduled patch release of v4
It will be followed up later this week with v3.18, which will backport a number of the features/fixes from Nuxt v4 to v3.
✅ Upgrading
Our recommendation for upgrading is to run:
npx nuxt upgrade --dedupe
This will deduplicate your lockfile as well, and help ensure that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
👉 Changelog
compare changes
🩹 Fixes
- nuxt: Add
nuxt.schema files to node tsconfig context (#32644)
- nuxt,vite: Unpin
nitropack (ed5ad64ad)
- nuxt: Expose shared aliases within
shared/ dir (#32676)
💅 Refactors
- nuxt: Pass file language directly to parser options (#32665)
📖 Documentation
- Remove rc tag in guide (232b14e2f)
- Remove
-t v4 tag from getting started (343f59235)
- Added new Shared folder to the example of v4 folder structure (#32630)
- Update nuxt.new links to v4 (#32639)
- Improve grammar (#32640)
- Typos (#32567)
- Fix abbreviation (#32613)
- Reference
noUncheckedIndexedAccess rule change in v4 guide (#32643)
- Add missing import in alias config example (#32648)
- Correct alias for local fonts in styling guide (#32680)
- Add best practices section (#31609)
- Fix links to Nitro docs (#32691)
📦 Build
- vite: Specify
nitropack types as external (39be1b3a9)
🏡 Chore
🤖 CI
- Trigger website redeploy on main branch (#32695)
❤️ Contributors
Compare Source
Nuxt 4.0 is here! 🎉
After a year of real-world testing, we're excited to announce the official release of Nuxt 4. This is a stability-focused major release, introducing a few thoughtful breaking changes in order to improve development experience.
If you've been following along, you'll recognize many of these features and changes — and if you're new to them, we hope you'll welcome them.
🔥 What's new?
Nuxt 4 is all about making your development experience smoother:
- Cleaner project organization with the new
app/ directory structure
- Smarter data fetching - we've taken the opportunity to address some inconsistencies and improve performance with the data layer
- Better TypeScript support with project-based separation between the different contexts in your project - app code, server code,
shared/ folder, and configuration
- Faster CLI and development with adoption of internal sockets and a faster CLI
Why these features in particular? Mostly because these kind of improvements have required making changes that are technically breaking.
In general, we aim for a hype-free approach to releases. Rather than save up features for a big release, we've been shipping improvements in Nuxt 3 minor releases.
We've also spent a lot of time figuring out how to implement these changes in a backwards-compatible way, and I hope that means that most Nuxt 3 projects can upgrade with a minimum of effort.
I'd advise reading through the upgrade guide before you start, to understand what areas of your app might be affected.
🗂️ New project structure
The biggest visible change is how projects are organized. Your application code now lives in an app/ directory by default:
my-nuxt-app/
├─ app/
│ ├─ components/
│ ├─ pages/
│ ├─ layouts/
│ └─ app.vue
├─ public/
├─ shared/
├─ server/
└─ nuxt.config.ts
This helps keep your code separate from node_modules/ and .git/, which makes file watchers faster (especially on Windows and Linux). It also gives your IDE better context about whether you're working with client or server code.
[!TIP]
Don't want to migrate? That's totally fine! Nuxt will detect your existing structure and keep working exactly as before.
🎨 Updated UI templates
Nuxt’s starter templates have an all new look, with improved accessibility, default titles, and template polish (#27843).
🔄 Smarter data fetching
We've made useAsyncData and useFetch work better. Multiple components using the same key now share their data automatically. There's also automatic cleanup when components unmount, and you can use reactive keys to refetch data when needed. Plus, we've given you more control over when cached data gets used.
Some of these features have already been made available in Nuxt v3 minor releases, because we've been rolling this out gradually. Nuxt v4 brings different defaults, and we expect to continue to work on this data layer in the days to come.
🔧 Better TypeScript experience
Nuxt now creates separate TypeScript projects for your app code, server code, shared/ folder, and builder code. This should mean better autocompletion, more accurate type inference and fewer confusing errors when you're working in different contexts.
[!TIP]
With Nuxt 4, you will only need one tsconfig.json file in your project root!
This is probably the single issue that is most likely to cause surprises when upgrading, but it should also make your TypeScript experience much smoother in the long run. Please report any issues you encounter. 🙏
⚡ Faster CLI and development
In parallel with the release of v4, we've been working on speeding up @nuxt/cli.
- Faster cold starts - Development server startup is noticeably faster
- Node.js compile cache - Automatic reuse of the v8 compile cache
- Native file watching - Uses
fs.watch APIs for fewer system resources
- Socket-based communication - The CLI and Vite dev server now communicate via internal sockets instead of network ports, reducing overhead — particularly on Windows
These improvements combined can make a really noticeable difference in your day-to-day development experience, and we have more planned.
🚀 How to upgrade
Although any major release brings breaking changes, one of our main aims for this release is to ensure that the upgrade path is as smooth as possible. Most of the breaking changes have been testable with a compatibility flag for over a year.
Most projects should upgrade smoothly, but there are a few things to be aware of:
- Nuxt 2 compatibility has been removed from
@nuxt/kit. (This will particularly affect module authors.)
- Some legacy utilities and deprecated features have been cleaned up.
- The new TypeScript setup might surface some type issues that were hidden before.
- A few modules might need further updates for full Nuxt 4 compatibility.
Don't worry though — for most breaking changes, there are configuration options to revert to the old behavior while you adjust.
1. Update Nuxt
Our recommendation for upgrading is to run:
npx nuxt upgrade --dedupe
This will deduplicate your lockfile as well, and help ensure that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
2. Optional: use migration tools
We’ve also partnered with Codemod to automate many, though not all, migration steps:
npx codemod@latest nuxt/4/migration-recipe
3. Test and adjust
Run your tests, check that everything builds correctly, and fix any issues that come up. The upgrade guide has detailed migration steps for specific scenarios.
We'd recommend reading through it in full before starting your upgrade, to understand what areas of your app might be affected.
🗺️ What's next?
We're planning quick patch releases to address any issues that come up. Nuxt 3 will continue to receive maintenance updates (both bug fixes and backports of features from Nuxt 4) until the end of January 2026, so there's no rush if you need time to migrate.
Looking ahead, we plan to release Nuxt 5 on the sooner side, which will bring Nitro v3 and h3 v2 for even better performance, as well as adopting the Vite Environment API for an improved (and faster!) development experience. And there's a lot more in the works too!
And, quite apart from major releases, we have a lot of exciting features planned to make their way into Nuxt 3.x and 4.x release branches, including support for SSR streaming (#4753), a first-party accessibility module (#23255), built-in fetch caching strategies (#26017), more strongly typed fetch calls (landing in Nitro v3), dynamic route discovery (#32196), multi-app support (#21635) and more.
❤️ Thank you
This release is credit to so many people, particularly those who have been testing v4 compatibility mode over the past year. I'm really grateful — thank you for all your help!
Happy coding with Nuxt 4! 🚀
👉 Changelog
compare changes
🚀 Enhancements
- ui-templates: Update template branding for v4 (#27843)
- deps: Upgrade to latest versions of c12, jiti and unbuild (#27995)
- kit: Reimplement cjs utils using
mlly (#28012)
- nuxt: Generate basic jsdoc for module config entry (#27689)
- schema: Split dev/prod build directories (#28594)
- nuxt: Cache vue app build outputs (#28726)
- deps: Update dependency vite to v6 (main) (#30042)
- nuxt: Add integration with chrome devtools workspaces (#32084)
- kit: Support single import in
addServerImports (#32289)
- nuxt: Add
onWatcherCleanup to imports presets (#32396)
- kit,nuxt,schema: Separate ts projects for node/app/nitro (#30665)
- nuxt: Support lazy hydration macros (#31192)
- nuxt: Export
<NuxtTime> prop types (#32547)
- nuxt: Add route announcer to default app.vue (#32621)
- nuxt: Expose page routes to nitro for o11y (#32617)
🔥 Performance
- nuxt: ⚠️ Don't call
render:html for server islands (#27889)
- vite: Don't write stub manifest for legacy bundler (#27957)
- kit: Update env expansion regex to match nitro (#30766)
- vite: Communicate with vite-node via internal socket (#32417)
🩹 Fixes
- schema,vite: ⚠️ Do not allow configuring vite dev bundler (#27707)
- schema: ⚠️ Default to
compatibilityVersion: 4 (#27710)
- nuxt: ⚠️ Emit absolute paths in
builder:watch hook (#27709)
- nuxt: ⚠️ Improve default
asyncData value behaviour (#27718)
- nuxt: ⚠️ Remove old experimental options (#27749)
- kit: ⚠️ Support loading nuxt 4 and dr
Uh oh!
There was an error while loading. Please reload this page.
This PR contains the following updates:
^2.15.8->^4.1.3Release Notes
nuxt/nuxt (nuxt)
v4.1.3Compare Source
✅ Upgrading
Our recommendation for upgrading is to run:
This will deduplicate your lockfile as well, and help ensure that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
👉 Changelog
compare changes
🔥 Performance
🩹 Fixes
prepare:typeshook (#33239)h(#33046)headoption onuseHead(#33318)cdnURLis set (#33333)imports.dirs(#33334)<NuxtLink>(#33335)v-slot:fallbacklongform syntax in<DevOnly>(#33368)typeFromwhen generating auto-import type templates (#33373)@nuxt/scripts(bed410d60)useAsyncData(#33325)_pathproperty configurable for HMR (#33379)useAsyncDatawith different key on ssr (#33341)💅 Refactors
typed-router.d.tsearly for consistency (#33285)nitro:prepare:typeshook (#33286)filenameintocomponentsIslandsTemplatedefinition (#33394)📖 Documentation
4.xprefix to all internal links (#33264)useFetchreactivity (#33317)4.xprefixes in urls (47ea684c7)nuxt.configpage (b438d44e1)preparecommandNODE_ENVbehavior (#33330)nuxtcommand pages (#33336)🏡 Chore
.npmrc(14514329b)✅ Tests
gotoPathtimeout in CI (f1e5a2d4c)🤖 CI
❤️ Contributors
v4.1.2Compare Source
✅ Upgrading
Our recommendation for upgrading is to run:
This will deduplicate your lockfile as well, and help ensure that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
👉 Changelog
compare changes
🔥 Performance
dstis present (#33200)hydrate-whenlazy hydration strategy (#33199)🩹 Fixes
pkg-typesto dependencies (9fe2541ca)backgroundSizein loading indicator (#33211)enabledfrom components dir options (#32844)📖 Documentation
app/suffix to a few links (#33217)🏡 Chore
✅ Tests
❤️ Contributors
v4.1.1Compare Source
✅ Upgrading
Our recommendation for upgrading is to run:
This will deduplicate your lockfile as well, and help ensure that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
👉 Changelog
compare changes
🩹 Fixes
globalThisoverwindow(#33125)deps.inline(#33133)useRouteusage warning (#33039)imports:sourcesin override warning (#33050)📖 Documentation
--to bun create command (5e661f0ca)app/prefix in lots of cases (#33117)navigateTo(#21442)🏡 Chore
rou3github url (#33130).tsextension (db9d840e1)🤖 CI
4xtags from releases (1cd8a6857)❤️ Contributors
v4.1.0Compare Source
👀 Highlights
🔥 Build and Performance Improvements
🍫 Enhanced Chunk Stability
Build stability has been significantly improved with import maps (#33075). This prevents cascading hash changes that could invalidate large portions of your build when small changes are made:
By default, JS chunks emitted in a Vite build are hashed, which means they can be cached immutably. However, this can cause a significant issue: a change to a single component can cause every hash to be invalidated, massively increasing the chance of 404s.
In short:
Obviously this wasn't optimal. With this new feature, the hash of (otherwise) unchanged files which import the entry won't be affected.
This feature is automatically enabled and helps maintain better cache efficiency in production. It does require native import map support, but Nuxt will automatically disable it if you have configured
vite.build.targetto include a browser that doesn't support import maps.And of course you can disable it if needed:
🦀 Experimental Rolldown Support
Nuxt now includes experimental support for
rolldown-vite(#31812), bringing Rust-powered bundling for potentially faster builds.To try Rolldown in your Nuxt project, you need to override Vite with the rolldown-powered version since Vite is a dependency of Nuxt. Add the following to your
package.json:npm:
{ "overrides": { "vite": "npm:rolldown-vite@latest" } }pnpm:
{ "pnpm": { "overrides": { "vite": "npm:rolldown-vite@latest" } } }yarn:
{ "resolutions": { "vite": "npm:rolldown-vite@latest" } }bun:
{ "overrides": { "vite": "npm:rolldown-vite@latest" } }After adding the override, reinstall your dependencies. Nuxt will automatically detect when Rolldown is available and adjust its build configuration accordingly.
For more details on Rolldown integration, see the Vite Rolldown guide.
🧪 Improved Lazy Hydration
Lazy hydration macros now work without auto-imports (#33037), making them more reliable when component auto-discovery is disabled:
This ensures that components that are not "discovered" through Nuxt (e.g., because
componentsis set tofalsein the config) can still be used in lazy hydration macros.📄 Enhanced Page Rules
If you have enabled experimental extraction of route rules, these are now exposed on a dedicated
rulesproperty onNuxtPageobjects (#32897), making them more accessible to modules and improving the overall architecture:The
defineRouteRulesfunction continues to work exactly as before, but now provides better integration possibilities for modules.🚀 Module Development Enhancements
Module Dependencies and Integration
Modules can now specify dependencies and modify options for other modules (#33063). This enables better module integration and ensures proper setup order:
This replaces the deprecated
installModulefunction and provides a more robust way to handle module dependencies with version constraints and configuration merging.🪝 Module Lifecycle Hooks
Module authors now have access to two new lifecycle hooks:
onInstallandonUpgrade(#32397). These hooks allow modules to perform additional setup steps when first installed or when upgraded to a new version:The hooks are only triggered when both
nameandversionare provided in the module metadata. Nuxt uses the.nuxtrcfile internally to track module versions and trigger the appropriate hooks. (If you haven't come across it before, the.nuxtrcfile should be committed to version control.)🙈 Enhanced File Resolution
The new
ignoreoption forresolveFiles(#32858) allows module authors to exclude specific files based on glob patterns:📂 Layer Directories Utility
A new
getLayerDirectoriesutility (#33098) provides a clean interface for accessing layer directories without directly accessing private APIs:✨ Developer Experience Improvements
🎱 Simplified Kit Utilities
Several kit utilities have been improved for better developer experience:
addServerImportsnow supports single imports (#32289):🔥 Performance Optimizations
This release includes several internal performance optimizations:
🐛 Notable Fixes
useFetchhook typing (#32891)<NuxtTime>(#32893)✅ Upgrading
As usual, our recommendation for upgrading is to run:
This will refresh your lockfile and pull in all the latest dependencies that Nuxt relies on, especially from the unjs ecosystem.
👉 Changelog
compare changes
🚀 Enhancements
ignoreoption toresolveFiles(#32858)onInstallandonUpgrademodule hooks (#32397)rolldown-vite(#31812)defineRouteRulesto pagerulesproperty (#32897)getLayerDirectoriesutil and refactor to use it (#33098)🔥 Performance
🩹 Fixes
satisfiesin page augmentation (#32902)useFetchhooks (#32891)resolvePathand normalize file extensions (#32857)requestTimeout+ allow configuration (#32874)node_modules/if no customsrcDir(#32987)routeobject (#32899)defineNuxtModule().with()(#33081)nuxtApp._runningTransitionon resolve (#33025)💅 Refactors
async/awaitinafterEach(#32999)📖 Documentation
setupTimeoutand addteardownTimeout(#32868)webRootto use new app directory (df7177bff)app/directory in layer guide (eee55ea41)--nightlycommand (#32907)features.inlineStylesdefault value (6ff3fbebb)useRouteand accessing route in middleware (#33004)🏡 Chore
type: 'module'in playground (#33099)✅ Tests
import.meta.dev(#33023)findWorkspaceDirrather than relative paths to repo root (a6dec5bd9)expect.poll(53fb61d5d)expect.pollinstead ofexpectWithPolling(357492ca7)vi.waitUntilinstead of custom retry logic (611e66a47)🤖 CI
❤️ Contributors
v4.0.3Compare Source
👉 Changelog
compare changes
🔥 Performance
tinyglobbyinresolveFiles(#32846)🩹 Fixes
errorvariable (#32807)typeCheck(#32835)nullresult from webpack call (84816d8a1)reverseResolveAliasfor better errors (#32853)📖 Documentation
bun.lockfor lockfile (#32820)🏡 Chore
✅ Tests
defineNuxtComponentout of e2e test (#32848)🤖 CI
❤️ Contributors
v4.0.2Compare Source
👉 Changelog
compare changes
🩹 Fixes
<ClientOnly>and<DevOnly>(#32707)defineAppConfigtype (#32760)appcontext (#32758)mllyto parse module paths (#32386)📖 Documentation
npm create nuxt@latest(#32726).with()(#32757)🏡 Chore
unbuildand use absolute path in dev stubs (#32759)✅ Tests
module.exportsexport (c4317e057)🤖 CI
pkg.pr.newformain/3.xbranches as well (b0f289550)3xtag to latest v3 release (5f6c27509)❤️ Contributors
v4.0.1Compare Source
✅ Upgrading
Our recommendation for upgrading is to run:
This will deduplicate your lockfile as well, and help ensure that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
👉 Changelog
compare changes
🩹 Fixes
nuxt.schemafiles to node tsconfig context (#32644)nitropack(ed5ad64ad)shared/dir (#32676)💅 Refactors
📖 Documentation
-t v4tag from getting started (343f59235)noUncheckedIndexedAccessrule change in v4 guide (#32643)📦 Build
nitropacktypes as external (39be1b3a9)🏡 Chore
🤖 CI
❤️ Contributors
v4.0.0Compare Source
Nuxt 4.0 is here! 🎉
After a year of real-world testing, we're excited to announce the official release of Nuxt 4. This is a stability-focused major release, introducing a few thoughtful breaking changes in order to improve development experience.
If you've been following along, you'll recognize many of these features and changes — and if you're new to them, we hope you'll welcome them.
🔥 What's new?
Nuxt 4 is all about making your development experience smoother:
app/directory structureshared/folder, and configurationWhy these features in particular? Mostly because these kind of improvements have required making changes that are technically breaking.
In general, we aim for a hype-free approach to releases. Rather than save up features for a big release, we've been shipping improvements in Nuxt 3 minor releases.
We've also spent a lot of time figuring out how to implement these changes in a backwards-compatible way, and I hope that means that most Nuxt 3 projects can upgrade with a minimum of effort.
I'd advise reading through the upgrade guide before you start, to understand what areas of your app might be affected.
🗂️ New project structure
The biggest visible change is how projects are organized. Your application code now lives in an
app/directory by default:This helps keep your code separate from
node_modules/and.git/, which makes file watchers faster (especially on Windows and Linux). It also gives your IDE better context about whether you're working with client or server code.🎨 Updated UI templates
Nuxt’s starter templates have an all new look, with improved accessibility, default titles, and template polish (#27843).
🔄 Smarter data fetching
We've made
useAsyncDataanduseFetchwork better. Multiple components using the same key now share their data automatically. There's also automatic cleanup when components unmount, and you can use reactive keys to refetch data when needed. Plus, we've given you more control over when cached data gets used.Some of these features have already been made available in Nuxt v3 minor releases, because we've been rolling this out gradually. Nuxt v4 brings different defaults, and we expect to continue to work on this data layer in the days to come.
🔧 Better TypeScript experience
Nuxt now creates separate TypeScript projects for your app code, server code,
shared/folder, and builder code. This should mean better autocompletion, more accurate type inference and fewer confusing errors when you're working in different contexts.This is probably the single issue that is most likely to cause surprises when upgrading, but it should also make your TypeScript experience much smoother in the long run. Please report any issues you encounter. 🙏
⚡ Faster CLI and development
In parallel with the release of v4, we've been working on speeding up
@nuxt/cli.fs.watchAPIs for fewer system resourcesThese improvements combined can make a really noticeable difference in your day-to-day development experience, and we have more planned.
🚀 How to upgrade
Although any major release brings breaking changes, one of our main aims for this release is to ensure that the upgrade path is as smooth as possible. Most of the breaking changes have been testable with a compatibility flag for over a year.
Most projects should upgrade smoothly, but there are a few things to be aware of:
@nuxt/kit. (This will particularly affect module authors.)Don't worry though — for most breaking changes, there are configuration options to revert to the old behavior while you adjust.
1. Update Nuxt
Our recommendation for upgrading is to run:
This will deduplicate your lockfile as well, and help ensure that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
2. Optional: use migration tools
We’ve also partnered with Codemod to automate many, though not all, migration steps:
3. Test and adjust
Run your tests, check that everything builds correctly, and fix any issues that come up. The upgrade guide has detailed migration steps for specific scenarios.
We'd recommend reading through it in full before starting your upgrade, to understand what areas of your app might be affected.
🗺️ What's next?
We're planning quick patch releases to address any issues that come up. Nuxt 3 will continue to receive maintenance updates (both bug fixes and backports of features from Nuxt 4) until the end of January 2026, so there's no rush if you need time to migrate.
Looking ahead, we plan to release Nuxt 5 on the sooner side, which will bring Nitro v3 and h3 v2 for even better performance, as well as adopting the Vite Environment API for an improved (and faster!) development experience. And there's a lot more in the works too!
And, quite apart from major releases, we have a lot of exciting features planned to make their way into Nuxt 3.x and 4.x release branches, including support for SSR streaming (#4753), a first-party accessibility module (#23255), built-in fetch caching strategies (#26017), more strongly typed fetch calls (landing in Nitro v3), dynamic route discovery (#32196), multi-app support (#21635) and more.
❤️ Thank you
This release is credit to so many people, particularly those who have been testing v4 compatibility mode over the past year. I'm really grateful — thank you for all your help!
Happy coding with Nuxt 4! 🚀
👉 Changelog
compare changes
🚀 Enhancements
mlly(#28012)addServerImports(#32289)onWatcherCleanupto imports presets (#32396)<NuxtTime>prop types (#32547)🔥 Performance
render:htmlfor server islands (#27889)🩹 Fixes
compatibilityVersion: 4(#27710)builder:watchhook (#27709)asyncDatavalue behaviour (#27718)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.