-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vue-router 3.0.5 router onComplete no longer executed #2721
Comments
thanks, it's probably related to the fix introduced in #2712 |
the callback wasn't passed correctly as the second argument: this.$router.push({ name: 'foo' }, function () {
// This will never execute
alert('callback');
}) it was passed like this: this.$router.push({ name: 'foo', function () {
// This will never execute
alert('callback');
}}) |
Sorry about the type in my example. It's weird that did sem to resolve the simplified version. In my code base however this problem persists but only in 3.0.5. I will dig deeper to see why. |
I'm also having a similar issue, tried it with 3.0.3 and 3.0.6. May be something specific to the codebase I'm working on but I'll try and get an example of it happening up later. To sum it up though. The callback doesn't seem to fire for any reason and as far as I can see my routes will always eventually resolve so I don't think it's an issue with the guards. |
@posva it still doesnt work, event if you change here https://codesandbox.io/embed/74y8ok1kpj to this |
Version
3.0.5
Reproduction link
https://codesandbox.io/embed/74y8ok1kpj
Steps to reproduce
In a vuex action I have a simple block of code:
In my action.js file for my auth module I have the following block of code:
What is expected?
The onComplete callback of the router.push call should be executed.
What is actually happening?
The onComplete callback of the router.push call should be executed.
I rolled back to 3.0.4 and this issue went away. This is code that I have not touched in 6 months and has had many vue-router upgrades without issue.
The reproduction link is a very simplified version simply click on "Click me for callback failure" you should get an alert showing the click event was executed. The route will change too: /#/foo but the callback of alert('callback') is never executed.
The text was updated successfully, but these errors were encountered: