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
Attempt to navigate to route with param explicitly undefined -- This works but throws TS issue
Attempt to then navigate using param as empty string -- This navigates to the page, but the URL does not change, (it actually goes to root I think), and in addition to this, it throws a TS error.
What is expected?
undefined is still an error, but empty string should work.
What is actually happening?
TS error, or runtime error.
When you do this.$router.push( { name: 'about', params: { id: undefined } } ). This works, but throws a TS error
When you do this.$router.push( { name: 'about', params: { id: '' } } ), this does NOT work, but throws no error.
It will "appear" as if it works (for the second) but will not actually change the URL, and will throw a console warn.
This issue does not occur for vue-router@4 & vue 3
(Kind of redundant)
The actual issue was stemmed from this code:
Version
3.6.5
Reproduction link
github.com
Steps to reproduce
What is expected?
undefined is still an error, but empty string should work.
What is actually happening?
TS error, or runtime error.
When you do this.$router.push( { name: 'about', params: { id: undefined } } ). This works, but throws a TS error
When you do this.$router.push( { name: 'about', params: { id: '' } } ), this does NOT work, but throws no error.
It will "appear" as if it works (for the second) but will not actually change the URL, and will throw a console warn.
This issue does not occur for vue-router@4 & vue 3
(Kind of redundant)
The actual issue was stemmed from this code:
^ This throws ts error
^ This throws runtime error
My point on this last part is that I can't simply just remove the param statement, its dynamic.
The text was updated successfully, but these errors were encountered: