-
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
[ng2] Uncaught (in promise): TransitionRejection(type: 5, message: The transition was ignored., detail: "undefined") #2676
Comments
Can you please fix the same problem for ng1? |
@adharris reports that this is still an issue in alpha.5 when a TargetState is returned from an onEnter hook.
|
@pdanpdan is there an issue for this for ng1? I'm not aware of the problem existing? Can you show me? |
Can't reproduce the report by @adharris that |
Able to reproduce now using @adharris example: https://github.com/adharris/quickstart-ng2/tree/4e5a06cf8ce5c596ae0d15af7359ab4b8ad67d36 Will fix in |
this also happens in the redirectTo hook on the state declaration. |
This should be fixed. Are you using the latest version? Can you explain exactly how to reproduce it? |
so, responding with anything inside the redirectTo on a state definition results in the transition superseded error message. it may be related to a different issue views: {
'': {
templateUrl: 'views/main/main.html',
controller: 'MainCtrl',
controllerAs: 'main'
}
},
redirectTo: function(trans){
// this causes an error message in the console
return trans.getResolveValue('startRoute');
//so does
return trans.router.stateService.target(trans.getResolveValue('startRoute'), newParams, stateOptions);
} |
Are you sure you're on the latest version ( |
That's correct. It happens successfully but still throws an error. We
should be on latest I will have to check in the morning
…On Wed, Dec 14, 2016 at 5:52 PM Chris Thielen ***@***.***> wrote:
Are you sure you're on the latest version (1.0.0-beta.3)? You shouldn't
get a superseded error when a redirect happens. Is the redirect functioning
properly, but you get the superseded message?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2676 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABp-H0vyD41dNCzcVhhGWzqP5jQPWxJqks5rII9CgaJpZM4IA4Qe>
.
|
@timothyswt if you verify you're on the latest, can you open a new issue for this? I can't reproduce it. |
@christopherthielen yes, I can reproduce it on Beta 3 |
After updating to ui-router 1.0.0-rc.1 (from beta3) and to angular 1.6 (from 1.5.8), I'm now getting the "Possibly unhandled rejection" error, with "The transition has been superceded by a different transition". Looking at the $trace output, it appears this is a result of redirectTo on my state (the initial transition is rejected and shows the "superceded" message in the trace, then successfully transitions to the state in redirectTo). From the comments, I gather this would have been fixed? Am I doing something wrong? |
I think beta.3 and above shouldn't have this problem. Do you happen to use the ui router visualizer too? |
No |
I just installed it. The chevrons show [success] -> [redirected] -> [success], while the (massive!) error gets dumped to the console... |
I was asking because I think the visualizer itself can cause this error to be logged. Thanks for following up. |
I am also seeing: angular.js:14328 Possibly unhandled rejection: {"type":2,"message":"The transition has been superseded by a different transition","detail":{"deferred":{"promise":{"$$state": With code similar to the below: var onBeforeStateHook = function(transition) {
if (!user.isLoggedIn()) {
if (transition.to().name !== 'login') {
var $state = transition.router.stateService;
return $state.target('login');
} else {
return true;
}
} else {
return true;
}
}
$transitions.onBefore({}, onBeforeStateHook); Stack trace for creation of unhandled rejected promise:
angular 1.6.1 and ui-router 1.0.0-rc1 The following modification suppresses the errors but breaks redirection: // issue #2676
var silenceUncaughtInPromise = function (promise) {
//return promise.catch(function (e) { return 0; }) && promise;
return promise.catch(function (e) { return 0; });
}; So it appears to be an issue with this function. |
I believe this is fixed by ui-router/core@a7464bb |
@christopherthielen Is it possible to use 1.0.0-rc1 with ui-router/core that has the fix or do we have to wait for a new release? For some reason, I am suddenly getting the following error after I added a new route. The new route I added has a different state name and different URL but it is being "ignored" due to "All states and parameters in the To and From paths are identical" Any idea?
|
@mocsharp 1.0.0 final was just released. I'm closing this ticket because it's a confusion of angular 1 angular 2. If there is still a problem, let's open a different ticket. |
A bug easy to reproduce with the ng2 ui router, just start the quickstart example (https://github.com/ui-router/quickstart-ng2), click on one of the state links (Foo for example), then reclick on Foo.
You get the following error in the console:
The text was updated successfully, but these errors were encountered: