-
Notifications
You must be signed in to change notification settings - Fork 3k
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
redirectTo causing The transition has been superseded by a different transition errors #3309
Comments
I am seeing similar behaviour. More details: #2676 (comment) This plunkr reproduces the problem: http://plnkr.co/edit/3Fp38M?p=preview Note use of multiple hooks and timeout promises.. I couldn't reproduce it without those. I suspect there may be a race condition in the 'reject silencing' that doesn't work if the promise doesn't resolve immediately.. or maybe the catching of rejected promises needs to work for the full chain when there are multiple transition hooks. |
i have the same issue with i tried recreate issue, but unsuccessful in my real app, when i switch between $trace enabled
clicking 2nd time same link
only 2nd click and following clicks on the same link gives the error |
I believe this will be fixed in rc.2by ui-router/core@a7464bb |
why close the issue when the fix has not even been released? we can't test it. |
Because the code that fixes the issue is committed to the master branch. This is how issue trackers work normally, isn't it? |
I'm still getting this error. Using 1.0.3. |
I've just updated to 1.0.3 and it doesn't work for me with following configuration:
But after removing
So I just ended up using the second config and additional abstract state for |
A problem is still there. I have one state with ui-sref-active in the template and another with a redirect to a third state. But everything works properly if I remove ui-sref-active from the template of the first state. |
@4O4 very interesting, and not expected. |
@Anber can you help me reproduce this in a plunker? http://bit.ly/UIR-Plunk1 |
@christopherthielen, I had been trying to reproduce it a whole day and I had begun to think that there is a problem in one of my deep tweaks of the router, but then I found one strange thing: in some cases a behaviour of the transitionService.onStart depends on the presence of ui-sref-active in the view's template. Unfortunately, I can't reproduce it in a plunker, but I can try to describe everything that I found and maybe you help me to understand what I missed.
In my application, transition from source to target state produces following trace log: If I remove ui-sref-active from source state (or just comment line with How you can see, there is one small difference in additional to error: unexpected call of http://plnkr.co/edit/cMnR7lD40hPqW5PsZ8uK?p=preview it's a very simplified structure of my application. Visualization of both transitions looks absolutely the same. |
Can confirm this also happens when transitioning to a child state using 1.0.3. Run block:
Results in:
Also happens when returning a promise which resolves to a target state. Navigating between parent and child state in this example will demonstrate the issue:
|
@erikbaan thanks for providing an example. In your example, the Is this the problem you're describing? That a redirected transition is triggering the If so, I'm afraid that's by design. When a transition is run, it will either fire the The original transition to If you have a global |
@Anber that's some good sleuthing. I'm still not sure how to reproduce this though :( |
1.0.4 is released |
Thanks all, this fixes the issue nicely for me 🎉 |
|
@Anber |
@christopherthielen, how I said before, it does not depend on redirectTo, it depends on |
@christopherthielen Thanks for this fix. Any idea on when 1.0.4 will hit npm? Edit: Ahh it seems the build failed. |
@christopherthielen I'm have the same issue as @Anber |
thanks ,and I'm using angular version 1.6, angular-ui-router is 1.0.4, the problem still exists, |
@christopherthielen Any chance of 1.0.4 landing on npm soon? Kind of need this fix in our next production release which is happening very soon. You mention it's been released 14 days ago but npm still says last version is 1.0.3 |
@adamreisnz are you sure? remember |
Renamed to what? No, I was still looking at https://www.npmjs.com/package/angular-ui-router ... It would have been great to have this communicated on the old npm page and add a deprecation warning to that package. One does not... simply rename the package and leave the old one up without warning ;) |
@adamreisnz a
|
Hmmm, I use yarn. It seems such words of warning are not uttered by it when installing. I will raise an issue for it there. |
Ok actually the issue does lie in this package. The warning message is logged by plain console logs during installation, but all of this gets swallowed by yarn if there is no 1 exit code. Instead, this command should be used to deprecate the package properly, so that users can be warned regardless of them using npm or yarn: https://docs.npmjs.com/cli/deprecate There's many yarn users out there, they will miss out on this warning if it's not properly deprecated. I will raise a separate issue for it though to not further derail this thread. |
I am using @uirouter/angularjs version 1.0.13 and have the same error:
or
|
on 1.0.11 and seeing this too |
the same for us, using v1.0.13
if we remove transition.abort() we get
|
Using v1.0.14 and seeing "The transition has been superseded by a different transition" error too. This answer https://stackoverflow.com/a/44654316 removes the error for me, but I would not like to add timeouts for every $state.go redirection. |
I am currently using version 1.0.14 using angular 1.6.x it give similar error when refreshing the page. |
Same here, we upgraded recently and we're logging a lot of these errors in Sentry:
@christopherthielen Is this a regression from the earlier fix? |
Same here on 1.0.15 |
Same too on 1.0.17 |
I get this when navigating through an abstract route on page refresh. Removing the abstract property on the parent route 'fixed' the issue. |
same on 1.0.16 |
I'm having same issue as well. angularjs 1.6.7 I'm getting the following error.
it was caused by |
So I found that using the .go() method causes the transitions error when attempting to employ the user auth example. I have a service that is promising to return a user, if it errors, I redirect the user to login. When using When using When using No error, and redirected as expected. UPDATE: Also I notice when passing a specified route parent like the example I could sometimes throw the error when attempting to access a protected route. However, using this seemed to resolve it as expected thus far. Hope this helps. AngularJS - 1.7.1 |
For me returning |
This appears fixed again in ui-router 1.0.19 and core 5.0.20. I'm seeing the messages of superseded transitions in the console, but they aren't triggering an unhandled exception. Will deploy to production shortly and report back if it still errors. |
Looks like this is still occasionally triggering an exception in our live environment. Have added the following filter to block these out: if (
typeof exception === 'object' &&
typeof exception.message === 'string' &&
exception.message.match(/^Possibly unhandled.+The transition errored/)
) {
return;
} |
In version 1.0.20, I'm seeing this when the application is slow to load, and the navigation is available for a user to try to go to a different state. Should this be considered an error at all when getting displayed in the console, perhaps the techniques that we're using are not as per recommended? |
That seems bad, considering lazy loading. |
We still have this problem with 1.0.25. Unfortunately we don't use |
use $state.dispose() before $state.go() |
just use $timeout(() => {
$state.go('login')
}) ui-router/src/directives/stateDirectives.ts Line 100 in 461d7b2
|
I'm getting a possibly handled rejection when a state redirects to itself with new parameters. The error is {"type":2,"message":"The transition has been superseded by a different transition", detail:... "redirected": true} Even though the error is logged, the transition continues as expected.
The error is uncaught in appendHookToChain (transition.js:604). It also does not come through the defaultErrorHandler so I have no way of stopping the error logging to the console. Stacktrace:
I'm using angular 1.6.1 and ui-router 1.0.0-rc.1. I've been trying to reproduce in plnkr but I'm having no luck.
The text was updated successfully, but these errors were encountered: