Upgrading nuxt 2 to 3
Breaking2.18.1 → 3.21.11Breaking86Security52Platform5Deprecated14New527Changed429Fixed1810Other2215
67 breaking changes and 5 platform requirement changes and 43 security fixes.
- Removes the obsolete `shortPath` property.
- The internal list of registered components is no longer attached to the server-side rendering context.
- The internal middleware name changed, so code referring to the old name must be updated.
- Removes the defineModel option as it is now stable.
No longer runs postinstall when installed.
Requires Node.js ^20.19.0 || >=22.12.0 from 3.18.0 (none stated before).
Adds @dxup/nuxt ^0.5.6, @nuxt/devtools ^3.4.1, @nuxt/kit 3.21.11, @nuxt/nitro-server 3.21.11, @nuxt/schema 3.21.11, @nuxt/vite-builder 3.21.11, @unhead/vue ^2.1.17, @vue/shared ^3.5.40, c12 ^3.3.4, chokidar ^5.0.0, compatx ^0.2.0, consola ^3.4.2, cookie-es ^2.0.1, defu ^6.1.7, destr ^2.0.5, devalue ^5.9.0, errx ^0.1.2, escape-string-regexp ^5.0.0, exsolve ^1.1.1, h3 ^1.15.11, hookable ^5.5.3, ignore ^7.0.6, impound ^1.1.6, jiti ^2.7.0, klona ^2.0.6, knitwork ^1.3.0, magic-string ^0.30.21, mlly ^1.8.2, nanotar ^0.3.0, nypm ^0.6.9, ofetch ^1.5.1, ohash ^2.0.11, on-change ^6.0.2, oxc-minify ^0.143.0, oxc-parser ^0.143.0, oxc-transform ^0.143.0, oxc-walker ^1.1.1, pathe ^2.0.3, perfect-debounce ^2.1.0, pkg-types ^2.3.1, rou3 ^0.9.1, scule ^1.3.0, semver ^7.8.5, std-env ^4.2.0, tinyglobby ^0.2.17, ufo ^1.6.4, ultrahtml ^1.7.0, uncrypto ^0.1.3, unctx ^2.5.0, unimport ^6.4.0, unplugin ^3.3.0, unplugin-vue-router ^0.19.2, untyped ^2.0.0, vue ^3.5.40, vue-router ^4.6.4.
Drops @nuxt/babel-preset-app, @nuxt/builder, @nuxt/components, @nuxt/config, @nuxt/core, @nuxt/generator, @nuxt/loading-screen, @nuxt/opencollective, @nuxt/server, @nuxt/utils, @nuxt/vue-app, @nuxt/vue-renderer, @nuxt/webpack.
Installs 698 packages in all (was 1296).
What you must change
shortPath property.shortPath_registeredComponents from ssrContext._registeredComponentsssrContextnuxtMiddlewareappMiddlewaredefineModelverbatimModuleSyntaxbuild.extend in webpack.build.extendRuntimeConfigPageMetaNuxtApp['payload']NuxtPayloadModuleMeta#headinitialCache option.initialCache404.vue shorthand.404.vuePrivateRuntimeConfig, autoImports, addAutoImport, defer, throwError, useActiveRoute, <Script>, <NuxtNestedPage>, <NuxtChild>, buildModules, and…PrivateRuntimeConfigautoImportsaddAutoImportaddImportsaddImportsDiruseAsyncDatainstallModulethrowErrorviewportcharsetuseHeadnuxt.configrefresh override previous requests by default.refreshautoImports to imports.autoImportsimportsmeta:register hook in nuxt.meta:registertitleTemplatedefineNuxtConfignuxtnuxt3@vue/runtime-coreComponentCustomPropertiesComponentCustomOptionsGlobalComponentsexperimental.treeshakeClientOnlyexperimental.configSchemaexperimental.polyfillVueUseHeadexperimental.respectNoSSRHeadersetIntervalreactivityTransform option for Vue 3.4.reactivityTransform~/layoutsrouteRulesswrisrx-nuxt-no-ssrexperimental.respectNoSSRHeaderevent.context.nuxt.noSSR#head@vueuse/headexperimental.polyfillVueUseHeadexperimental.viteNodevite.devBundlerfork-ts-checker-webpack-plugin$f fetch prefix only to auto-generated keys.$fnuxi generate.nuxi generateuseFetch key.useFetchNuxtRenderHTMLContext.bodyPrepend.NuxtRenderHTMLContext.bodyPrependhead option support into defineNuxtComponent.headdefineNuxtComponent$f fetch prefix to auto-keys.$fapp.pageTransitionapp.layoutTransitiondefineEventHandler()eventHandler()fromNodeMiddleware()NuxtPage#componentsnuxi initnuxt initnuxi init.nuxi initapp:rendered to modify the SSR context and adds a new render:html hook.app:renderedrender:htmlvitecomposables/components/globalstatusCode[[, requiring [slug] at the end of a route to be rewritten as [[slug]].[slug][[slug]]@nuxt/kitexperimental.renderJsonPayloadsnuxt test.nuxt testvitest/node subpath export in test-utils.vitest/node@nuxt/devtoolsv-fortemplateruntimeCompilerHigh · CVSS 8.1as prop for islands.asnavigateTo and reloadNuxtApp: SSR open redirect, client-side script execution via the open option, and protocol-relative bypass in reloadNuxtAppisScriptProtocolnavigateToreloadNuxtAppModerate · CVSS 6.1<NuxtClientFallback> SSR output.NuxtClientFallbackNoScriptLowreloadNuxtApp.reloadNuxtAppvite-nodeModerate · CVSS 5.5<NuxtLink> href.NuxtLink<NuxtLink> via unsanitised javascript: or data: URLnavigateTo() external redirect__nuxt_island endpoint does not bind responses to request props, enabling shared-cache poisoning.server.vue pages via /__nuxt_island/page_*appMiddleware on dynamic and catch-all routesdevServer.corsvite.server.fs.allownuxt.configfetchvitest@types/node^16.11.0 to ^16.10.0.Deprecations to plan for
createErrorstatusCodestatusMessagestatusstatusTextImportPresetWithDeprecation in kit, nuxt and schema.ImportPresetWithDeprecationextend, extendConfig, and configResolved hooks in schema.extendextendConfigconfigResolvedprocess.* flags.process.*pending value in data fetching composables.pendingdedupe option.dedupebuild.extendbuild.extend hook in webpack.build.extendpublicruntimeConfigruntimeConfig<Script> component tag in templates.<Script>autoImports option and hooks, renamed to imports.autoImportsimports