nuxt
4.6.4 · 2 Nov 2026MIT3.6M / weekRepositoryHomepagenpmAtom feed
3.21.11 is the newest release of 3.x.
In short
1 breaking20 new8 faster29 fixed40 internal
- Breaking
Although we have aimed to maintain backward compatibility and put breaking changes behind the
experimental.granularCachedDataflag (disabled by default), we recommend testing your application thoroughly after upgrading.
Security
18 advisories affect 3.17.0; 4.6.2 fixes the others
- ModerateNuxt exposes the message and data of unhandled errors thrown during server renderingGHSA-96x6-fvhx-49hg · 16 Nov 2026No fix yet
- ModerateNuxt: Incomplete fix for GHSA-6gq8-jgmh-3ffp: an encoded slash (`%2F`) in the request path bypasses route rules on catch-all page routesGHSA-f3x9-2chm-73c8 · 16 Nov 2026No fix yet
- ModerateNuxt: Server-side route rules (`redirect`, `headers`, `proxy`, `ssr`) are skipped for case-variant paths when routing is case-insensitiveGHSA-vjh5-4x84-xrqp · 22 Oct 2026No fix yet
- HighNuxt: Unauthenticated CPU exhaustion parsing and hashing the Nuxt island endpoint body before hash validationGHSA-9pgf-384g-p7mv · 5 Aug 2026Fixed in 3.21.10
- HighNuxt: Server-Side Remote Code Execution via Runtime Template Injection in Nuxt Server Island PropsGHSA-9473-5f9j-94wq · 5 Aug 2026Fixed in 3.21.10
13 more
- HighNuxt: Unauthenticated out-of-memory crash via unbounded v-for expansion in island renderingGHSA-hxcr-hm88-mpq6 · 5 Aug 2026Fixed in 3.21.10
- HighNuxt: Route-rule middleware bypass via case-sensitivity mismatch between vue-router and the routeRules matcherGHSA-mm7m-92g8-7m47 · 16 Jun 2026Fixed in 3.21.7
- ModerateNuxt server islands render `useHeadSafe` input without sanitisationGHSA-xfq5-w38q-pc2x · 22 Oct 2026Fixed in 4.6.2
- ModerateNuxt: Route rules are matched against the raw request path, so a percent-encoded segment can bypass `appMiddleware` on dynamic and catch-all routesGHSA-6gq8-jgmh-3ffp · 22 Oct 2026Fixed in 3.21.4
- ModerateNuxt: Unauthorized Component Instantiation via Server Island PropsGHSA-48hr-524c-v5w3 · 5 Aug 2026Fixed in 3.21.10
- ModerateNuxt: Reflected XSS in `<NuxtLink>` via unsanitised `javascript:` or `data:` URLGHSA-934w-87qh-qr26 · 16 Jun 2026Fixed in 3.21.7
- ModerateNuxt: URL-handling weaknesses in `navigateTo` and `reloadNuxtApp`: SSR open redirect, client-side script execution via the `open` option, and protocol-relative bypass in `reloadNuxtApp`GHSA-c9cv-mq2m-ppp3 · 16 Jun 2026Fixed in 3.21.7
- ModerateNuxt's route middleware is not enforced when rendering `.server.vue` pages via `/__nuxt_island/page_*`GHSA-hg3f-28rg-4jxj · 29 May 2026Fixed in 3.21.6
- ModerateNuxt: Reflected XSS in `navigateTo()` external redirectGHSA-fx6j-w5w5-h468 · 19 May 2026Fixed in 3.21.6
- LowNuxt: Incomplete fix for GHSA-934w-87qh-qr26: a `javascript:` URL prefixed with an ASCII control character executes from `<NuxtLink>` when `pages` is disabledGHSA-jjm6-p2m9-9w4x · 22 Oct 2026Fixed in 4.6.0
- LowCross-site scripting via <NoScript> slot content in Nuxt's head componentsGHSA-m3q2-p4fw-w38m · 16 Jun 2026Fixed in 3.21.7
- LowNuxt: `__nuxt_island` endpoint does not bind responses to request props, enabling shared-cache poisoningGHSA-g8wj-3cr3-6w7v · 19 May 2026Fixed in 3.21.6
- LowNuxt has Client-Side Path Traversal in Nuxt Island Payload RevivalGHSA-p6jq-8vc4-79f6 · 17 Sep 2025Fixed in 3.19.0
Release note
Highlights
This release brings a major reworking of the async data layer, a new built-in component, better warnings, and performance improvements!
Data Fetching Improvements
A major reorganization of Nuxt's data fetching layer brings significant improvements to useAsyncData and useFetch.
Although we have aimed to maintain backward compatibility and put breaking changes behind the experimental.granularCachedData flag (disabled by default), we recommend testing your application thoroughly after upgrading. You can also disable experimental.purgeCachedData to revert to the previous behavior if you are relying on cached data being available indefinitely after components using useAsyncData are unmounted.
👉 Read the the original PR for full details (#31373), but here are a few highlights.
Consistent Data Across Components
All calls to useAsyncData or useFetch with the same key now share the underlying refs, ensuring consistency across your application:
<!-- ComponentA.vue -->
<script setup>
const { data: users, pending } = useAsyncData('users', fetchUsers)
</script>
<!-- ComponentB.vue -->
<script setup>
// This will reference the same data state as ComponentA
const { data: users, status } = useAsyncData('users', fetchUsers)
// When either component refreshes the data, both will update consistently
</script>This solves various issues where components could have inconsistent data states.
Reactive Keys
You can now use computed refs, plain refs, or getter functions as keys:
const userId = ref('123')
const { data: user } = useAsyncData(
computed(() => `user-${userId.value}`),
() => fetchUser(userId.value)
)
// Changing the userId will automatically trigger a new data fetch
// and clean up the old data if no other components are using it
userId.value = '456'Optimized Data Refetching
Multiple components watching the same data source will now trigger only a single data fetch when dependencies change:
// In multiple components:
const { data } = useAsyncData(
'users',
() => $fetch(`/api/users?page=${route.query.page}`),
{ watch: [() => route.query.page] }
)
// When route.query.page changes, only one fetch operation will occur
// All components using this key will update simultaneouslyBuilt-In Nuxt Components
<NuxtTime> - A new component for safe time display
We've added a new <NuxtTime> component for SSR-safe time display, which resolves hydration mismatches when working with dates (#31876):
<template> <NuxtTime :datetime="Date.now()" /> </template>
The component accepts multiple time formats and gracefully handles both client and server rendering.
Enhanced <NuxtErrorBoundary>
The <NuxtErrorBoundary> component has been converted to a Single File Component and now exposes error and clearError from the component - as well as in the error slot types, giving you greater ability to handle errors in your templates and via useTemplateRef (#31847):
<NuxtErrorBoundary @error="handleError">
<template #error="{ error, clearError }">
<div>
<p>{{ error.message }}</p>
<button @click="clearError">Try again</button>
</div>
</template>
<!-- Content that might error -->
<MyComponent />
</NuxtErrorBoundary>Router Improvements
<NuxtLink> now accepts a trailingSlash prop, giving you more control over URL formatting (#31820):
<NuxtLink to="/about" trailing-slash>About</NuxtLink> <!-- Will render <a href="/about/"> -->
Loading Indicator Customization
You can now customize the loading indicator with new props directly on the component (#31532):
hideDelay: Controls how long to wait before hiding the loading barresetDelay: Controls how long to wait before resetting loading indicator state
<template> <NuxtLoadingIndicator :hide-delay="500" :reset-delay="300" /> </template>
Documentation as a Package
The Nuxt documentation is now available as an npm package! You can install @nuxt/docs to access the raw markdown and YAML content used to build the documentation website (#31353).
Developer Experience Improvements
We've added several warnings to help catch common mistakes:
Warning when server components don't have a root element #31365
Warning when using the reserved
runtimeConfig.appnamespace #31774Warning when core auto-import presets are overridden #29971
Error when
definePageMetais used more than once in a file #31634
Enhanced Module Development
Module authors will be happy to know:
A new
experimental.enforceModuleCompatibilityallows Nuxt to throw an error when a module is loaded that isn't compatible with it (#31657). It will be enabled by default in Nuxt v4.You can now automatically register every component exported via named exports from a file with
addComponentExports#27155
Performance Improvements
Several performance improvements have been made:
Switched to
tinyglobbyfor faster file globbing #31668Excluded
.datadirectory from type-checking for faster builds #31738Improved tree-shaking by hoisting the
purgeCachedDatacheck #31785
Upgrading
Our recommendation for upgrading is to run:
npx nuxi@latest upgrade --dedupe
This refreshes your lockfile and pulls in all the latest dependencies that Nuxt relies on, especially from the unjs ecosystem.
Changelog
Enhancements
nuxt: Accept
hideDelayandresetDelayprops for loading indicatornuxt: Warn server components need root element
kit,nuxt: Pass dotenv values from
loadNuxtConfigto nitronuxt,vite: Support disabling scripts in dev mode
nuxt: Warn if user uses reserved
runtimeConfig.appnamespacekit,schema: Allow throwing error if modules aren't compatible
nuxt: Extract
middlewarewhen scanning page metadatanuxt: Warn if core auto-import presets are overridden
nuxt: Scan named exports with
addComponentExportsnuxt: Convert
<NuxtErrorBoundary>to SFC + exposeerror/clearErrornuxt: Add
<NuxtTime>component for ssr-safe time displaynuxt: Add
trailingSlashprop to<NuxtLink>
Performance
kit,rspack,webpack: Switch to
tinyglobbykit: Exclude
.datadirectory from type-checkingnuxt: Hoist
purgeCachedDatacheck to improve tree-shakingnuxt: Remove
oxc-parsermanual wasm fallback logicnuxt: Remove unecessary type check for useFetch
Fixes
kit,vite: Ensure all
modulesDirpaths are added tofs.allownuxt: Pass slots through to lazy hydrated components
vite: Do not return 404 for dev server handlers which shadow
/_nuxt/nuxt: Sync error types for
useLazyAsyncDatanuxt: Strip base url from
error.urlnuxt: Render inline styles before
app:renderedis callednuxt: Update nitro imports
nuxt: Check for
fallbackattribute when stripping<DevOnly>vite: Invalidate files not present in module graph
nuxt: Do not add manifest preload when
noScriptsnuxt: Do not prompt to update
compatibilityDatenuxt: Show brotli size by default when analyzing bundle
nuxt: Always pass
statusMessagewhen rendering html errornuxt: Error when
definePageMetais used more than oncenuxt: Parse
error.databefore renderingerror.vuenuxt: Use single synced asyncdata instance per key
nuxt: Use
useAsyncDatain console lognuxt: Wait for suspense to resolve before handling
NuxtErrorBoundaryerrorvite: Disable
preserveModulesnuxt: Align
pendingwithstatusvalue for v4nuxt: Consider full path when de-duplicating routes
nuxt: Augment
nuxt/appin generated middleware and layouts declarationsnuxt: Correct order of args passed to
withoutBasevite: Dedupe
vuein vite-node dev serverui-templates: Pass pointer events through spotlight div in error dev template
kit: Include user-defined types before internal ones in
tsconfig.jsonnuxt: Do not purge nuxt data if active
useNuxtDatanuxt: Do not include components of key in
useFetchwatch sourcesnuxt: Use first existing
modulesDirto store build cache files
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.