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-10-18.

11 breaking1 security5 deprecations19 new APIs and options2 performance10 behavior and defaults7 tooling52 fixes and other

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

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

vue-router 5103 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 5

  • 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 17

  • 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 2

  • 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 10

Tooling 7

  • 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 50

  • 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 44 changes

New APIs and options 2

  • Experimental basic alias support was added.

    4.6.4release notes

  • Experimental support was added for handling redirect types.

    4.6.4release notes

Fixes and other changes 2

  • 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