Nuxt 4.3 brings powerful new features for layouts, caching, and developer experience – plus significant performance improvements under the hood.
You can now set layouts directly in route rules using the new appLayout property (#31092). This provides a centralized, declarative way to manage layouts across your application without scattering definePageMeta calls throughout your pages.
export default defineNuxtConfig({
routeRules: {
'/admin/**': { appLayout: 'admin' },
'/dashboard/**': { appLayout: 'dashboard' },
'/auth/**': { appLayout: 'minimal' }
}
})
This is particularly useful for:
setPageLayout improvements below.Payload extraction now works with ISR (incremental static regeneration), SWR (stale-while-revalidate) and cache routeRules (#33467). Previously, only pre-rendered pages could generate _payload.json files.
This means:
export default defineNuxtConfig({
routeRules: {
'/products/**': {
isr: 3600, // Revalidate every hour
}
}
})
Related to the above, payload extraction now also works in development mode (#30784). This makes it easier to test and debug payload behavior without needing to run a production build.
nitro.static set to true, or for individual pages which have isr, swr, prerender or cache route rules.When extending Nuxt layers, you can now disable specific modules that you don't need (#33883). Just pass false to the module's options:
export default defineNuxtConfig({
extends: ['../shared-layer'],
// disable @nuxt/image from layer
image: false,
})
Route groups (folders wrapped in parentheses like (protected)/) are now exposed in page meta (#33460). This makes it easy to check which groups a route belongs to in middleware or anywhere you have access to the route.
<script setup lang="ts">
// This page's meta will include: { groups: ['protected'] }
useRoute().meta.groups
</script>
export default defineNuxtRouteMiddleware((to) => {
if (to.meta.groups?.includes('protected') && !isAuthenticated()) {
return navigateTo('/login')
}
})
This provides a clean, convention-based approach to route-level authorization without needing to add definePageMeta to every protected page.
setPageLayoutThe setPageLayout composable now accepts a second parameter to pass props to your layout (#33805):
export default defineNuxtRouteMiddleware((to) => {
setPageLayout('admin', {
sidebar: true,
theme: 'dark'
})
})
<script setup lang="ts">
defineProps<{
sidebar?: boolean
theme?: 'light' | 'dark'
}>()
</script>
#server AliasA new #server alias provides clean imports within your server directory (#33870), similar to how #shared works:
// Before: relative path hell
import { helper } from '../../../../utils/helper'
// After: clean and predictable
import { helper } from '#server/utils/helper'
The alias includes import protection – you can't accidentally import #server code from client or shared contexts.
The development error overlay introduced in Nuxt 4.2 is now draggable and can be minimized (#33695). You can:
This is a quality-of-life improvement when you're iterating on fixes and don't want the overlay blocking your view.
Module authors can now use async functions when adding build plugins (#33619):
export default defineNuxtModule({
async setup() {
// Lazy load only when actually needed
addVitePlugin(() => import('my-cool-plugin').then(r => r.default()))
// No need to load webpack plugin if using Vite
addWebpackPlugin(() => import('my-cool-plugin/webpack').then(r => r.default()))
}
})
This enables true lazy loading of build plugins, avoiding unnecessary code loading when plugins aren't needed.
This release includes several performance optimizations for faster builds:
nuxt:ssr-styles plugin is now significantly faster (#33862, #33865)rou3, removing the need for radix3 in the client bundle and eliminating app manifest fetches (#33920)The inlineStyles feature now works with webpack and rspack builders (#33966), not just Vite. This enables critical CSS inlining for better Core Web Vitals regardless of your bundler choice.
statusCode → status, statusMessage → statusTextIn preparation for Nitro v3 and H3 v2, we're moving to use Web API naming conventions (#33912). The old properties still work but are deprecated in advance of v5:
- throw createError({ statusCode: 404, statusMessage: 'Not Found' })
+ throw createError({ status: 404, statusText: 'Not Found' })
Notable fixes in this release:
key attribute (#33958, #33963)useCookie unsafe number parsing during decode (#34007)NuxtPage not re-rendering when nested NuxtLayout has layouts disabled (#34078)allowArbitraryExtensions by default in TypeScript config (#34084)noUncheckedIndexedAccess to server tsconfig for safer typing (#33985)noUncheckedIndexedAccess in the Nitro server TypeScript config improves type safety but may surface new type errors in your server code. This change was necessary because Nuxt's app context performs type checks on server routes (learn more).While we recommend keeping this enabled for better type safety, you can disable it if needed:export default defineNuxtConfig({
nitro: {
typescript: {
tsConfig: {
compilerOptions: {
noUncheckedIndexedAccess: false
}
}
}
}
})
Our recommendation for upgrading is to run:
npx nuxt upgrade --dedupe
This will deduplicate your lockfile and help ensure you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
Thank you to all of the many contributors to this release! 💚