nuxt
4.6.4 · 2 Nov 2026MIT3.6M / weekRepositoryHomepagenpmAtom feed
3.21.11 is the newest release of 3.x.
In short
5 breaking1 deprecated19 new1 faster9 fixed1 changed22 internal
- Breaking
Previously it was possible to pass the
x-nuxt-no-ssrheader (undocumented) to force SPA rendering. We've now disabled this behaviour by default but you can get it back by settingexperimental.respectNoSSRHeaderto true. Alternatively, you can setevent.context.nuxt.noSSRon the server to force SPA rendering. - Breaking
We've removed the (deprecated)
#headalias and also disabled the polyfill for@vueuse/headbehaviour by default. (It can still be enabled withexperimental.polyfillVueUseHead.) - Breaking
We've removed the (deprecated)
experimental.viteNodeoption. It can be configured instead withvite.devBundler. - Breaking
We've deprecated accessing public runtime config without the
publickey. This was an undocument compatibility measure with Nuxt 2 and we plan to remove it entirely in v3.5. - Breaking
To fix a bug with our vue-router integration, we now generate a slightly different path matching syntax. If you were relying on the exact path generated, have a look at #19902 for more information.
- Deprecated
nuxt: Deprecate old (pre-rc) runtimeConfig
Security
15 advisories affect 3.4.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
- Criticalnuxt Code Injection vulnerabilityGHSA-gc34-5v43-h7v8 · 13 Jun 2023Fixed in 3.4.3
10 more
- 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
- 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 allows DOS via cache poisoning with payload rendering responseGHSA-jvhm-gjrh-3h93 · 19 Mar 2025Fixed in 3.16.0
- 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 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
Release note
3.4.0 is a minor (feature) release for Nuxt 3 bringing exciting new features, including support for the View Transitions API, transferring rich JavaScript payloads from server to client - and much more.
Highlights
View Transitions API Support
user-images.githubusercontent.com/904724/231222…
You can see a demo on nuxt-view-transitions.surge.sh
You may have noticed that Chromium-based browsers now ship a new web platform API: the View Transitions API. This is an exciting new ability for native browser transitions which (among other things) have the ability to transition between unrelated elements on different pages.
Nuxt now ships with an experimental implementation, which will be under active development during the v3.4 release cycle. See the known issues in the linked PR.
export default defineNuxtConfig({
experimental: {
viewTransition: true
}
})Payload Enhancements
We've merged a significant change to how Nuxt handles payloads (under an experimental flag). Payloads are used to send data from the server to the client when doing server-side rendering and avoid double data-fetching during the hydration phase.
export default defineNuxtConfig({
experimental: {
renderJsonPayloads: true
}
})With this new option enabled, this now means that various rich JS types are supported out-of-the-box: regular expressions, dates, Map and Set and BigInt as well as NuxtError - and Vue-specific objects like ref, reactive, shallowRef and shallowReactive.
You can find an example in our test suite.
This is all possible due to Rich-Harris/devalue#58. For a long time, Nuxt has been using our own fork of devalue owing to issues serialising Errors and other non-POJO objects, but we now have transitioned back to the original.
You can even register your own custom types with a new object-syntax Nuxt plugin:
export default definePayloadPlugin(() => {
definePayloadReducer('BlinkingText', data => data === '<original-blink>' && '_')
definePayloadReviver('BlinkingText', () => '<revivified-blink>')
})You can read more about how this works here.
Note: this only affects payloads of the Nuxt app, that is, data stored within useState, returned from useAsyncData or manually injected via nuxtApp.payload. It does not affect data fetched from Nitro server routes via $fetch or useFetch although this is one area I am keen to explore further.
Preliminary testing shows a significant speed-up: 25% faster in total server response time for a very minimal app with a large JSON payload, but I'd urge you to run your own tests and share the results with us.
As mentioned, we're merging this behind a flag so we can test this broadly and gather feedback on the new approach. The most significant potential change is that the payload is now no longer available on window.__NUXT__ immediately. Instead, we now need to initialise the Nuxt app to parse the payload so any code that accesses __NUXT__ will need to be run in a plugin or later in the Nuxt app lifecycle. Please feel free to raise an issue if you foresee or encounter issues in your projects.
Object-syntax Nuxt plugins
We now support object-syntax Nuxt plugins for better control over plugin order and easier registration of hooks.
export default defineNuxtPlugin({
name: 'my-plugin',
enforce: 'pre', // or 'post'
async setup (nuxtApp) {
// this is the equivalent of a normal functional plugin
},
hooks: {
// You can directly register Nuxt app hooks here
'app:created'() {
const nuxtApp = useNuxtApp()
//
}
}
})In future we plan to enable build optimizations based on the metadata you pass in your Nuxt plugins.
Easier Devtools Configuration
It's even easier to enable Nuxt DevTools in your project: just set devtools: true in your nuxt.config file to enable devtools.
export default defineNuxtConfig({
devtools: true
})If it's not already installed, Nuxt will prompt to install it locally. This means you no longer need to have Nuxt DevTools enabled globally.
Note: the DevTools is still experimental and under active development, so do be prepared for occasional unexpected behaviour, and please report issues directly to github.com/nuxt/devtools 🙏
Layers Improvements
We now support transforming ~/~~/@/@@ aliases within layers, meaning you now no longer need to use relative paths when importing within layers.
This should mean it is much easier to use a 'normal' Nuxt project as a layer without needing to specially write it as one.
Better Context Transforms
We now transform certain keys of definePageMeta and defineNuxtComponent which means you should have fewer issues with a missing Nuxt instance. This includes support accessing the Nuxt instance after an await within asyncData and setup functions for those still using the Options API. And you no longer need to wrap middleware and validate with defineNuxtRouteMiddleware when using async functions.
Ecosystem Updates
As usual, this release will pull in upstream improvements, including the new Consola v3 and Nitropack v2.3.3 (a new minor is expected shortly).
'Breaking fixes'
We've also taken the opportunity to do some cleanup in this minor release.
- Breaking
Previously it was possible to pass the
x-nuxt-no-ssrheader (undocumented) to force SPA rendering. We've now disabled this behaviour by default but you can get it back by settingexperimental.respectNoSSRHeaderto true. Alternatively, you can setevent.context.nuxt.noSSRon the server to force SPA rendering. - Breaking
We've removed the (deprecated)
#headalias and also disabled the polyfill for@vueuse/headbehaviour by default. (It can still be enabled withexperimental.polyfillVueUseHead.) - Breaking
We've removed the (deprecated)
experimental.viteNodeoption. It can be configured instead withvite.devBundler. - Breaking
We've deprecated accessing public runtime config without the
publickey. This was an undocument compatibility measure with Nuxt 2 and we plan to remove it entirely in v3.5. - Breaking
To fix a bug with our vue-router integration, we now generate a slightly different path matching syntax. If you were relying on the exact path generated, have a look at #19902 for more information.
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.
With Nuxt v3.4.0, we now advise that you explicitly install the @types/node version that matches your Node version.
Changelog
Enhancements
nuxt: Warn in dev when
useRouteis used in middlewarenuxt: Support disabling
watchwithuseFetchnuxt: Support
~/~~/@/@@aliases within layersnuxt: Respect custom
dir.pagesin page placeholdernuxt: Support vue runtime compiler
test-utils: Allow mounting single component for testing
nuxt: Experimental option for rich json payloads
nuxt: Prompt to install
devtoolswhen it's enabledUpgrade to consola v3.x prerelease
nuxt: Add experimental View Transitions API support
nuxt: Support async transform of object properties
nuxt: Support object-syntax plugins
nuxt: Add
experimentalNoScriptsroute rulenuxt: Add chokidar watcher debug timing
Performance
head: Disable
@vueuse/headpolyfill by default
Fixes
nuxt: End route param tokens manually
nuxt: Disable
x-nuxt-no-ssrheader by defaultkit: Support calling Nuxt 2 modules with module container
nuxt: Add types for globally injected
$configobjectnuxt: Throw error on protocol relative path in
useFetchnuxt: Add
@types/nodeas a peerDependencynuxt: Test all custom app config keys for
anynuxt: Add key to
.clientcomponent placeholdersnuxt: Add
undefinedtype foruseCookiereturn value- Deprecated
nuxt: Deprecate old (pre-rc) runtimeConfig
cli: Preview nitro build with custom dir config
nuxt: Default nitro autoImports to
imports.autoImportnuxi, vite: Suppress sourcemap + native fetch warnings
schema: Allow
ignorePrefixto be changed
Styles
Lint
Enable
sort-importseslint rule
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.