You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In VueRouter v3 it was possible to use a relative redirect (no leading slash in the redirect path) and if redirected to a child path, the path was concatenating like "parentPath/childPath".
Seems like this is no longer how it works in VueRouter v4 and instead it doesn't seem to respect the parentPath and only uses childPath when determining the final redirect location. This brings tons of troubles in our application as we were heavily relying on that logic before, so I hope for advice.
The text was updated successfully, but these errors were encountered:
This change was indeed intended: relatives paths are always resolved based on the current location to avoid inconsistencies to how Relative URLs work. In your case, the first redirect is absolute, it works, the second one is relative, it resolves to a route you don't have and then it stops. I recommend you to do one of these:
use absolute paths in redirects
use named routes for a deterministic route location
remove the links in your application that are using any of the routes that have a redirect
This has been overlooked in the migration guide, if you can, it would be a great contribution!
Reproduction
https://jsfiddle.net/y1Luxt7v/
Steps to reproduce the bug
Expected behavior
Url shows "url: /app/dashboard/list/sublist"
Actual behavior
2a. url shows "url: /_display/dashboard/list"
2b. url shows "url: /_display/dashboard/dashboard/list"
Additional information
In VueRouter v3 it was possible to use a relative redirect (no leading slash in the redirect path) and if redirected to a child path, the path was concatenating like
"parentPath/childPath"
.Seems like this is no longer how it works in VueRouter v4 and instead it doesn't seem to respect the
parentPath
and only useschildPath
when determining the final redirect location. This brings tons of troubles in our application as we were heavily relying on that logic before, so I hope for advice.The text was updated successfully, but these errors were encountered: