nuxt
4.6.4 · 2 Nov 2026MIT3.6M / weekRepositoryHomepagenpmAtom feed
3.21.11 is the newest release of 3.x.
In short
19 new7 faster44 fixed61 internal
Security
20 advisories affect 3.11.0; 4.6.0 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
- CriticalNuxt vulnerable to remote code execution via the browser when running the test locallyGHSA-v784-fjjh-f8r4 · 5 Aug 2024Fixed in 3.12.4
- 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
15 more
- 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
- 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
- HighNuxt allows DOS via cache poisoning with payload rendering responseGHSA-jvhm-gjrh-3h93 · 19 Mar 2025Fixed in 3.16.0
- 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
- Moderatenuxt vulnerable to Cross-site Scripting in navigateTo if used after SSRGHSA-vf6r-87q4-2vjf · 5 Aug 2024Fixed in 3.12.4
- 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 is possibly the last minor release before Nuxt v4, and so we've packed it full of features and improvements we hope will delight you! ✨
Better logging
When developing a Nuxt application and using console.log in your application, you may have noticed that these logs are not displayed in your browser console when refreshing the page (during server-side rendering). This can be frustrating, as it makes it difficult to debug your application. This is now a thing of the past!
Now, when you have server logs associated with a request, they will be bundled up and passed to the client and displayed in your browser console. Asynchronous context is used to track and associate these logs with the request that triggered them. (#25936).
For example, this code:
<script setup>
console.log('Log from index page')
const { data } = await useAsyncData(() => {
console.log('Log inside useAsyncData')
return $fetch('/api/test')
})
</script>will now log to your browser console when you refresh the page:
Log from index page
[ssr] Log inside useAsyncData
at pages/index.vue👉 We also plan to support streaming of subsequent logs to the Nuxt DevTools in future.
We've also added a dev:ssr-logs hook (both in Nuxt and Nitro) which is called on server and client, allowing you to handle them yourself if you want to.
If you encounter any issues with this, it is possible to disable them - or prevent them from logging to your browser console.
export default defineNuxtConfig({
features: {
devLogs: false
// or 'silent' to allow you to handle yourself with `dev:ssr-logs` hook
},
})Preview mode
A new usePreviewMode composable aims to make it simple to use preview mode in your Nuxt app.
const { enabled, state } = usePreviewMode()When preview mode is enabled, all your data fetching composables, like useAsyncData and useFetch will rerun, meaning any cached data in the payload will be bypassed.
Cache-busting payloads
We now automatically cache-bust your payloads if you haven't disabled Nuxt's app manifest, meaning you shouldn't be stuck with outdated data after a deployment.
Middleware routeRules
It's now possible to define middleware for page paths within the Vue app part of your application (that is, not your Nitro routes) (#25841).
export default defineNuxtConfig({
routeRules: {
'/admin/**': {
// or appMiddleware: 'auth'
appMiddleware: ['auth']
},
'/admin/login': {
// You can 'turn off' middleware that would otherwise run for a page
appMiddleware: {
auth: false
}
},
},
})⌫ New clear data fetching utility
Now, useAsyncData and useFetch expose a clear utility. This is a function that can be used to set data to undefined, set error to null, set pending to false, set status to idle, and mark any currently pending requests as cancelled.
<script setup lang="ts">
const { data, clear } = await useFetch('/api/test')
const route = useRoute()
watch(() => route.path, (path) => {
if (path === '/') clear()
})
</script>New #teleports target
Nuxt now includes a new <div id="teleports"></div> element in your app within your <body> tag. It supports server-side teleports, meaning you can do this safely on the server:
<template>
<Teleport to="#teleports">
<span>
Something
</span>
</Teleport>
</template>Loading indicator and transition controls
It's now possible to set custom timings for hiding the loading indicator, and forcing the finish() method if needed (#25932).
There's also a new page:view-transition:start hook for hooking into the View Transitions API (#26045) if you have that feature enabled.
Server- and client-only pages
This release sees server- and client-only pages land in Nuxt! You can now add a .server.vue or .client.vue suffix to a page to get automatic handling of it.
Client-only pages will render entirely on the client-side, and skip server-rendering entirely, just as if the entire page was wrapped in <ClientOnly>. Use this responsibly. The flash of load on the client-side can be a bad user experience so make sure you really need to avoid server-side loading. Also consider using <ClientOnly> with a fallback slot to render a skeleton loader (#25037).
⚗️ Server-only pages are even more useful because they enable you to integrate fully-server rendered HTML within client-side navigation. They will even be prefetched when links to them are in the viewport - so you will get instantaneous loading (#24954).
Server component bonanza
When you are using server components, you can now use the nuxt-client attribute anywhere within your tree (#25479).
export default defineNuxtConfig({
experimental: {
componentIslands: {
selectiveClient: 'deep'
}
},
})You can listen to an @error event from server components that will be triggered if there is any issue loading the component (#25798).
Finally, server-only components are now smartly enabled when you have a server-only component or a server-only page within your project or any of its layers (#26223).
Warning
Server components remain experimental and their API may change, so be careful
before depending on implementation details.
Performance improvements
We've shipped a number of performance improvements, including only updating changed virtual templates (#26250), using a 'layered' prerender cache (#26104) that falls back to filesystem instead of keeping everything in memory when prerendering - and lots of other examples.
Public assets handling
We have shipped a reimplementation of Vite's public asset handling, meaning that public assets in your public/ directory or your layer directories are now resolved entirely by Nuxt (#26163), so if you have added nitro.publicAssets directories with a custom prefix, these will now work.
Chunk naming
We have changed the default _nuxt/[name].[hash].js file name pattern for your JS chunks. Now, we default to _nuxt/[hash].js. This is to avoid false positives by ad blockers triggering off your component or chunk names, which can be a very difficult issue to debug.
You can easily configure this to revert to previous behaviour if you wish:
export default defineNuxtConfig({
vite: {
$client: {
build: {
rollupOptions: {
output: {
chunkFileNames: '_nuxt/[name].[hash].js',
entryFileNames: '_nuxt/[name].[hash].js'
}
}
}
}
},
})Type fixes
Previously users with shamefully-hoist=false may have encountered issues with types not being resolved or working correctly. You may also have encountered problems with excessive type instantiation.
We now try to tell TypeScript about certain key types so they can be resolved even if deeply nested (#26158).
There are a whole raft of other type fixes, including some regarding import types (#26218 and #25965) and module typings (#25548).
Upgrading
As usual, our recommendation for upgrading is to run:
nuxi upgrade --force
This will refresh your lockfile as well, and ensures that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
Changelog
Enhancements
nuxt: Server-only pages
nuxt: Client-only pages
nuxt: Allow using
nuxt-clientin all componentsnuxt: Add
page:view-transition:starthooknuxt: Custom loading reset/hide delay + force
finish()nuxt: Emit error if
<NuxtIsland>can't fetch islandnuxt:
usePreviewModecomposablenuxt: Support async transforms for data composables
nuxt: Add dedicated
#teleportselement for ssr teleportsnuxt: Enable islands if server pages/components present
nuxt: Allow generating metadata for nuxt components
vite: Handle multiple/custom public dirs
schema: Allow configuring type hoists with
typescript.hoistnuxt: Pass nuxt instance to
getCachedDatanuxt: Pass server logs to client
nuxt: Add
nuxtMiddlewareroute rulenuxt: Add
clearutility touseAsyncData/useFetch
Performance
Early return chained functions with falsy values
nuxt: Don't check
isPrerenderedin dev for server pagenuxt: Use fallthrough cache for prerender
nuxt: Tree shake island renderer
nuxt: Skip adding selective-client code if not enabled
nuxt: Use faster approach to check cache exists
nuxt: Only update changed templates
Fixes
kit: Apply nuxt types to
.config/nuxt.configkit: Widen pattern to
.config/nuxt.*nuxt: Align
errorinshowError/createErrorwith h3kit: Don't warn if middleware is added twice
nuxt: Don't try to strip directory file extensions
nuxt: Produce valid css selector from
useIdschema: Add
vueCompilerOptionsproperty totsConfignuxt: Skip vue style blocks in unctx transform
nuxt: Pass event to
useRuntimeConfigin Nuxt rendererschema: Disable
typescript.shimin favour of volarnuxt: Only check if server page is prerendered on client
nuxt: Don't refetch server components in initial html
nuxt: Resolve
defu/h3paths in type templatesnuxt: Use exported
toExportsfromunimportnuxt: Cache-bust payloads with build id
nuxt: Export
AsyncDataRequestStatustypenuxt: Add space before
<html>and<body>attrskit: Resolve module
node_modulesformodulesDirnuxt: Handle external redirects from
routeRulesnuxt: Use flat cache directory for prerender data
nuxt: Watch custom
cookieRefvalues deeplynuxt: Access prerender cache synchronously
nuxt: Provide typescript aliases for core packages
nuxt: Handle errors resolving package paths
kit: Handle errors resolving module path
nuxt: Clone paths to prevent shared object
nuxt: Detect component usage within
ssrRendernuxt: Improved plugin annotating warnings
nuxt: Generate typed routes after pages are scanned
nuxt: Only strip supported extensions when generating import types
nuxt: Init payload when using islands with
ssr: falsenuxt: Register/scan plugins with jsx/tsx extensions
nuxt: Update auto imports after other templates
nuxt: Respect
baseUrlwithin server componentsnuxt: Access shared asyncData state with
useNuxtDatavite: Explicitly import
publicAssetsURLnuxt: Don't ignore any files from
buildAssetsDirvite: Drop name prefix for client chunk file names
kit: Clone middleware when adding to app
nuxt: Don't generate separate chunk for stubs
nuxt: Use
joinRelativeURLfor build assetsschema: Allow passing
deeptoselectiveClientschema: Don't hoist types for
consolafor nownuxt: Guard
windowaccess more carefullynuxt: Provide appMiddleware types with universal router
nuxt: Handle nightly releases for hoisted types
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.