unstale

npm / vue-router

vue-router

What changed in vue-router 4 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

13 breaking1 security7 deprecations32 new APIs and options4 performance17 behavior and defaults10 tooling81 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

vue-router 5143 changes

Breaking changes 11

  • Experimental hash handling no longer decodes the hash and only protects encoding.

    5.4.0release notes

  • Experimental query params cannot be both required and have a default.

    5.4.0release notes

  • Experimental query values are normalized to arrays, changing the shape developers receive when reading query values.

    5.4.0release notes

  • Experimental redirects no longer inherit params, query, or hash.

    5.4.0release notes

  • The type for a definePage param default is stricter.

    5.1.0release notes

  • The experimental miss() now throws internally and returns never.

    5.0.3release notes

  • The experimental selectNavigationResult API is removed.

    5.0.3release notes

  • The package uses type module.

    5.0.3release notes

  • Devtools are removed from the IIFE build.

    5.0.2release notes

  • Missing param parsers now produce a runtime error.

    5.0.0release notes

  • The IIFE build no longer includes @vue/devtools-api because its upgraded v8 does not expose an IIFE build.

    5.0.0release notes

Security 1

  • Query objects use Object.create(null) to prevent prototype pollution.

    5.0.7release notes

Deprecations 6

  • Warns when repeatable params are passed as scalars.

    5.5.1release notes

  • Warns about removal of legacy optional params.

    5.4.0release notes

  • The discarded params warning now hints at the params: {} workaround.

    5.0.7release notes

  • NavigationResult is deprecated in favor of reroute(to).

    5.0.3release notes

  • Using the next() callback in navigation guards now triggers a deprecation warning.

    5.0.3release notes

  • Experimental resolver warns against non-absolute aliases.

    5.0.3release notes

New APIs and options 25

  • Adds RouterLink support for experimental_createRouter.

    5.5.1release notes

  • Adds useLink support for experimental_createRouter.

    5.5.1release notes

  • With definePage props true, route params can be declared in defineProps().

    5.5.0release notes

  • Adds hotUpdateCallback to the auto-resolver handleHotUpdate type.

    5.5.0release notes

  • Adds experimental customization of scroll restoration capture listeners and exports their default setup.

    5.5.0release notes

  • Makes scroll-restoration capture triggers configurable.

    5.5.0release notes

  • Adds experimental support for type safe route record props.

    5.5.0release notes

  • Adds the typedDefineProps option to sfc-typed-router.

    5.5.0release notes

  • createRouter accepts a prebuilt matcher.

    5.4.0release notes

  • Experimental definePage can extract hash params.

    5.4.0release notes

  • Experimental definePage allows custom regular expressions for path params.

    5.4.0release notes

  • Experimental support lets developers configure required and default hash params.

    5.4.0release notes

  • Adds onRouteRendered.

    5.4.0release notes

  • Adds UseScrollRestoration for scroll restoration.

    5.4.0release notes

  • The useRouter() return type can be overridden through the experimental types config.

    5.1.0release notes

  • Raw param parsers can be forced to have an array type.

    5.1.0release notes

  • Repeatable params are supported in subsegments as an experimental feature.

    5.1.0release notes

  • Param parsers now support include and exclude options.

    5.0.7release notes

  • Standard schema param parsers are now supported.

    5.0.5release notes

  • Nested folders support _parent; conflicts warn, and _parent is non-matchable by default.

    5.0.3release notes

  • Adds experimental reroute() as the replacement for NavigationResult.

    5.0.3release notes

  • Data loaders are added as an experimental feature.

    5.0.0release notes

  • resolveOptions is exposed for unplugin integrations.

    5.0.0release notes

  • The Volar plugin allows configuring rootDir.

    5.0.0release notes

  • A route JSON schema is added.

    5.0.0release notes

Performance 4

  • Strips definePage properties at build time.

    5.5.0release notes

  • Watches page files only in the dev server.

    5.5.0release notes

  • Resolves absolute locations without depending on the current route.

    5.3.0release notes

  • Avoids tracking currentRoute for absolute string locations.

    5.3.0release notes

Behavior and default changes 13

  • Avoids full stack traces for match misses in the experimental router.

    5.5.1release notes

  • Warns about relative object locations before the initial navigation in the experimental router.

    5.5.1release notes

  • Warns when query keys collide with route params.

    5.5.0release notes

  • Hashes and the top position are restored by default.

    5.4.0release notes

  • Skips scroll computation based on history.scrollRestoration.

    5.3.0release notes

  • The global Router type can be overridden.

    5.1.0release notes

  • defineParamParser() was made more intuitive.

    5.0.7release notes

  • Aliases are displayed in logs.

    5.0.3release notes

  • Experimental resolvers now handle aliasOf.

    5.0.3release notes

  • Aliases are extracted from definePage.

    5.0.3release notes

  • Experimental resolvers generate aliases from overrides.

    5.0.3release notes

  • Warns when routes have conflicting components.

    5.0.3release notes

  • Query params are optional by default.

    5.0.0release notes

Tooling 8

  • When definePage props is true, defineProps() is typed with route params.

    5.5.0release notes

  • Narrows typeof useRoute in a type context.

    5.3.0release notes

  • Adds helpful diagnostics for developers.

    5.2.0release notes

  • The params.path value in definePage is typed.

    5.1.0release notes

  • Vite is added as an optional peer dependency for types.

    5.1.0release notes

  • Automatic types are added for param parsers.

    5.0.0release notes

  • unplugin-vue-router is merged into the core package, so developers can upgrade to Vue Router 5 instead of using it as a separate package.

    5.0.0release notes

  • Volar plugins are added for use with Vue Router.

    5.0.0release notes

Fixes and other changes 75

  • Reads quoted keys in definePage() at build time.

    5.5.1release notes

  • Refines param separator matching.

    4.6.5, 5.5.1release notesrelease notes

  • Keeps userinfo by using relative URLs in pushState.

    5.5.1release notes

  • Resolves relative object locations against the current route in the experimental router.

    5.5.1release notes

  • Displays the location on its own line in this experimental diagnostic.

    5.5.1release notes

  • Keeps aliased named imports during definePage extraction.

    5.5.0release notes

  • Supports definePage with webpack and rspack.

    5.5.0release notes

  • Preserves named-view props and detects quoted props keys.

    5.5.0release notes

  • Restores scroll position after native hash links.

    5.5.0release notes

  • Handles pending async component roots in onRouteRendered.

    5.5.0release notes

  • Reserves keys for pending async pages.

    5.5.0release notes

  • Keeps non-object props when merging.

    5.5.0release notes

  • Removes query params set to undefined.

    5.5.0release notes

  • Allows undefined on push for query params with a default.

    5.5.0release notes

  • Keeps the query value for params omitted from params.

    5.5.0release notes

  • Avoids exponential backtracking when matching .* repeatable params.

    5.5.0release notes

  • Matches root paths with multiple optional params.

    5.5.0release notes

  • Reloads pages with stale route props.

    5.5.0release notes

  • Accepts classic parseQuery in RouterOptions.

    5.5.0release notes

  • Saves scroll positions in sessionStorage instead of history.state.

    5.5.0release notes

  • Overwrites parent capture and restore.

    5.5.0release notes

  • Avoids calling replaceState on pagehide when scrollRestoration is manual.

    5.5.0release notes

  • Keeps scroll positions in memory when sessionStorage fails and ignores invalid stored positions.

    5.5.0release notes

  • Adds a useId fallback for vapor.

    5.5.0release notes

  • useRoute() returns the route prop in descendants.

    5.5.0release notes

  • Sanitizes the named view in a definePage import.

    5.4.0release notes

  • Experimental guard redirects during history navigation are resolved against the navigation target.

    5.4.0release notes

  • Experimental hash parameter parsing is aligned with query parsing.

    5.4.0release notes

  • Experimental hash params can be optional and nullable.

    5.4.0release notes

  • Duplicate hash params keep the last value instead of throwing.

    5.4.0release notes

  • Keeps the declared case of a static prefix when building a matcher pattern path.

    5.4.0release notes

  • Keeps hexadecimal character codes in parameter-segment regular expressions.

    5.4.0release notes

  • Experimental query params with defaults are optional when pushing a route.

    5.4.0release notes

  • Hash params with defaults are excluded from the required set.

    5.4.0release notes

  • Obsolete scroll positions are invalidated.

    5.4.0release notes

  • Handles non-string params for isActive.

    5.3.1release notes

  • Prevents a race condition that caused a dev-only error.

    5.3.0release notes

  • Allows unsetting a route name with false.

    5.3.0release notes

  • Generated parameter types are sorted and deduplicated.

    5.3.0release notes

  • Unnamed parameters are omitted from generated route types.

    5.3.0release notes

  • Generates parameter types from override paths and stops inheritance on absolute overrides.

    5.3.0release notes

  • Skips saving scroll position when the pop direction is unknown.

    5.3.0release notes

  • Reports unnamed parameters once per route.

    5.3.0release notes

  • Removes the listener to prevent focus stealing in Edge.

    5.3.0release notes

  • Vue Router now allows Pinia 4.

    5.2.0release notes

  • Ignores stale asynchronous scrollBehavior results.

    5.2.0release notes

  • Rejects invalid hex digits in [x+hh] character codes.

    5.2.0release notes

  • Invalid query params are filtered without causing route matching to fail.

    5.1.0release notes

  • Undefined values are allowed for params in query.

    5.1.0release notes

  • definePage path-param parser overrides are now applied.

    5.0.7release notes

  • Param tokens are finalized before an escaped colon is processed.

    5.0.7release notes

  • The unplugin no longer generates empty routes.

    5.0.7release notes

  • Resolved params omit empty optional params.

    5.0.7release notes

  • RouteNamedMap is wired through generated routes.d.ts.

    5.0.7release notes

  • Fixes a missing closing quote in a generated import.

    5.0.6release notes

  • Tracking definePage imports per-file fixes a named view race condition.

    5.0.5release notes

  • Hashes on string locations are no longer decoded twice.

    5.0.5release notes

  • Allows pushing to auto routes.

    5.0.4release notes

  • Restores context across sequential awaits in loaders.

    5.0.4release notes

  • Prevents false duplicate route warnings for named views.

    5.0.4release notes

  • Avoids iterator helpers for Node 20 compatibility.

    5.0.4release notes

  • Escapes backslashes in string literals.

    5.0.4release notes

  • Auto-routes no longer include non-matchable routes.

    5.0.3release notes

  • Nested groups are handled correctly.

    5.0.3release notes

  • _parent.vue files no longer have a name.

    5.0.3release notes

  • Route ordering is stable for group folders with the same path and corrected for group nodes with inflated scores.

    5.0.3release notes

  • Old route overrides are cleaned up.

    5.0.3release notes

  • The RouteMapGeneric constraint is relaxed for interface-based RouteNamedMap.

    5.0.3release notes

  • Fixes handling of empty options in Volar.

    5.0.2release notes

  • The vue-router version check is loosened.

    5.0.2release notes

  • Typed plugins now work with vue-tsc.

    5.0.1release notes

  • Navigation guards are triggered when a keep-alive component is reactivated for a different route.

    5.0.0release notes

  • A fix avoids breaking support for older browsers.

    5.0.0release notes

  • Param parsers work when the declaration file is not at the root.

    5.0.0release notes

  • Tildes in paths are escaped.

    5.0.0release notes

vue-router 422 changes

Breaking changes 2

  • The IIFE build no longer includes @vue/devtools-api after that dependency was upgraded to v8, which does not expose an IIFE build.

    4.0.0upgrade guide

  • Remove the separate dependency when migrating file-based routing to Vue Router 5, where it is merged into the core package.

    4.0.0upgrade guide

Deprecations 1

  • A warning was added because this file will be removed in the next major release.

    4.6.1release notes

New APIs and options 7

  • Experimental basic alias support was added.

    4.6.4release notes

  • Experimental support was added for handling redirect types.

    4.6.4release notes

  • The bundler build file was added back for better retro compatibility with existing wrappers.

    4.6.1release notes

  • Navigation status provides more information for improving user experience with global UI elements such as progress bars and modals.

    4.0.0release notes

  • The new exports reference lists this path for generated routes.

    4.0.0upgrade guide

  • Import the Pinia Colada loader from this path.

    4.0.0upgrade guide

  • Import the plugin for Webpack, Rollup, and esbuild, along with unplugin utilities, from this path.

    4.0.0upgrade guide

Behavior and default changes 4

  • Routes can be added dynamically, with automatic path parsing and ranking so routes can be defined in any order.

    4.0.0release notes

  • Guards can return values previously passed to next, avoiding common mistakes; the previous approach remains supported for migration.

    4.0.0release notes

  • Route params, query, and hash are consistently encoded across browsers; values passed to router.push() need no manual encoding and appear decoded in route locations.

    4.0.0release notes

  • Scroll behavior is more consistent and matches native browser behavior.

    4.0.0release notes

Tooling 2

  • Vue Router integrates with the new Vue Devtools to provide navigation in the timeline and a route directory for debugging routes.

    4.0.0release notes

  • Use this import path for the Vite plugin previously imported from unplugin-vue-router/vite.

    4.0.0upgrade guide

Fixes and other changes 6

  • Escape - in static path tokens.

    4.6.5release notes

  • The build output was made compatible with v4.5.

    4.6.4release notes

  • Experimental isActive handling was fixed for custom params.

    4.6.4release notes

  • ESM browser builds were reinstated, allowing developers to use those builds again.

    4.6.3release notes

  • Avoids passing a leading ? to parseQuery.

    4.6.2release notes

  • Import data loader APIs such as defineBasicLoader and DataLoaderPlugin from this path.

    4.0.0upgrade guide