name: nuxt-skilld description: 'Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js. ALWAYS use when writing code importing "nuxt". Consult for debugging, best practices, or modifying nuxt.' metadata: version: 4.4.5 generated_by: cached generated_at: 2026-05-16
nuxt/nuxt nuxt@4.4.5
Tags: 1x: 1.4.5, 2x: 2.18.1, alpha: 4.0.0-alpha.4
References: package.json • README • Docs • Issues • Discussions • Releases
Search
Use skilld search "query" -p nuxt instead of grepping .skilld/ directories. Run skilld search --guide -p nuxt for full syntax, filters, and operators.
Nuxt v4.4.5 API Changes
This section documents version-specific API changes in Nuxt v4, prioritizing recent minor releases and breaking changes.
API Changes
NEW:
createUseFetch()factory — create customuseFetchinstances with default options and custom merge logic sourceNEW:
createUseAsyncData()factory — create customuseAsyncDatainstances with preconfigured defaults sourceNEW:
useAnnouncer()composable — announce dynamic in-page changes to screen readers viapolite()andassertive()methods; use with<NuxtAnnouncer>component sourceNEW:
<NuxtAnnouncer>component — render live region for dynamic announcements alongside<NuxtRouteAnnouncer>sourceBREAKING:
useStatereset behavior —clearNuxtState()now resets to initial value instead ofundefinedsourceBREAKING:
clearNuxtStatereset behavior — resets state to default value, aligning withuseAsyncDatasourceNEW:
useCookierefreshoption — extend cookie expiration without changing value viarefresh: truesourceBREAKING: Vue Router v5 — upgraded from v4; removes dependency on
unplugin-vue-routersourceNEW:
definePageMetalayoutobject — pass{ name, props }to set typed layout props per-page sourceNEW:
normalizeComponentNamesexperimental option — normalise page component names to match route names sourceNEW: View Transitions Types support — define view transition types for different navigation patterns source
NEW:
payloadExtraction: 'client'mode — inline full payload in HTML response while generating_payload.jsonfor client navigation sourceNEW:
routeRulesappLayoutproperty — set layout centrally via route rules without scatteringdefinePageMetacalls sourceNEW:
useRoute().meta.groups— route groups (parentheses-wrapped folders) now exposed in route meta sourceNEW:
setPageLayout()with props — second parameter to pass typed props to layout sourceNEW:
#serveralias — clean imports from server directory (import { helper } from '#server/utils/helper') with import protection sourceNEW: ISR/SWR payload extraction —
routeRulesisr,swr, andcachenow generate_payload.jsonfor cached pages sourceNEW: Dev mode payload extraction — payload extraction now works in dev mode with
nitro.static: trueor per-route rule sourceNEW: Module disabling — disable layer modules by passing
falseto options (image: false) sourceDEPRECATED:
statusCode→status,statusMessage→statusText— prepare for Nitro v3 and H3 v2 Web API naming sourceNEW:
useAsyncDataAbortController signal — pass{ signal }from handler or torefresh()/execute()for fine-grained request cancellation sourceNEW: Better error pages in dev — technical error overlay appears alongside custom error page source
NEW: Vite Environment API (experimental) — opt in via
experimental.viteEnvironmentApi: truefor Vite 6 multi-environment support sourceNEW:
extractAsyncDataHandlers(experimental) — extract async data handler functions into separate chunks for smaller client bundles on static sites sourceNEW:
component.declarationPath— specify custom declaration path for components sourceNEW:
setGlobalHead()utility — new kit utility for easier global head management sourceNEW:
resolveModuleextensionsoption — resolve modules with custom file extensions sourceNEW:
moduleDependencies— specify module dependencies with version constraints and configuration merging sourceNEW:
onInstallhook — module lifecycle hook called on first installation sourceNEW:
onUpgradehook — module lifecycle hook called when upgraded to new version sourceNEW:
resolveFilesignoreoption — exclude specific files via glob patterns sourceNEW:
getLayerDirectories()utility — clean interface for accessing layer directories without private API access sourceNEW:
addServerImportssingle import — support single import object alongside array format sourceNEW:
entryImportMap(experimental) — use import maps for stable chunk hashing; auto-enabled, can be disabled sourceNEW: Rolldown support (experimental) — Rust-powered bundling available via
rolldown-viteoverride sourceNEW:
defineLazyHydrationComponent()without auto-imports — lazy hydration macros work withcomponents: falsesourceNEW:
NuxtPagerulesproperty — route rules now exposed on dedicated property source
Also changed: future.compatibilityVersion: 5 opt-in for v5 breaking changes · @nuxt/nitro-server internal package extraction · TypeScript plugin support (experimental) via experimental.typescriptPlugin · Async plugin constructors in modules
Best Practices
Avoid browser-only APIs during SSR by using SSR-friendly composables — direct access to
localStorageorwindowin the setup phase causes hydration mismatches. UseuseCookie,useState, or wrap browser code inonMountedor<ClientOnly>sourceLazy-load components with the
Lazyprefix to reduce initial bundle size — import as<LazyComponentName>to dynamically load component code only when needed, useful for components not required on first render sourceUse
hydrate-on-visibleattribute on components to defer hydration until viewport visibility — delays JavaScript initialisation for components below the fold, improving time-to-interactive for the critical path sourceSet
parallel: truefor asynchronous plugins to enable concurrent loading — by default, plugins load sequentially blocking the hydration phase; concurrent loading improves performance when you have multiple independent async plugins sourceUse lifecycle hooks (
onInstall,onUpgrade) for one-time module setup tasks — defer expensive operations like database schema generation or config file creation from the module's setup function to avoid running them on every build sourceMinimise payload size with the
pickoption on data fetching — only extract fields you actually use in your template to reduce the amount of data serialized from server to client during hydration sourceAlways create explicit keys with
useAsyncDatato avoid unreliable auto-generated ones — auto-generated keys based on file and line number can cause data misses when using the composable inside custom wrappers or loops; provide a unique string key instead sourceUse
$fetchfor client-only interactions anduseFetchfor SSR-safe initial data —$fetchmakes direct network calls suitable for event handlers;useFetchprevents double-fetching by forwarding server data to the client in the payload sourceWrap shared state in composables using
useStateinstead of top-level refs — exportingconst state = ref()directly causes state to leak across requests on the server; always wrap in a composable likeexport const useState = () => useState('key')sourceUse
useSeoMetafor type-safe SEO meta tags instead ofuseHead— provides full IDE autocomplete and typo prevention for common SEO properties likeogTitle,twitterCard, anddescriptionsourceAvoid expensive plugin computations during hydration — large plugin setup blocks rendering and degrades UX; inspect and migrate plugin logic to composables or utilities whenever possible source
Prefix module exports (components, composables, server routes) with your module name — prevents naming conflicts with other modules, Nuxt internals, or user code; use
/api/_moduleName/for routes and<ModuleNameButton>for components sourceUse computed or ref-based keys with
useAsyncDatafor reactive data fetching — when combined with reactive dependencies, the data refetches automatically and old cached data is cleaned up if no other components reference it sourceFavour composables over plugins for shared logic — plugins run globally during hydration and reduce performance; most utilities and helper functions can be used directly as composables without the overhead source
Related: vue-skilld, vue-router-skilld