Skip to content
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

Error: transition superseded #3246

Closed
reviloera opened this issue Jan 5, 2017 · 40 comments
Closed

Error: transition superseded #3246

reviloera opened this issue Jan 5, 2017 · 40 comments
Labels
Milestone

Comments

@reviloera
Copy link

Am getting this error Error: transition superseded how can I solve it

@JVojczekhovskiy
Copy link

Same here. pls fix

@aestheticsdata
Copy link

Are you accessing directly a state ?

@justinotero
Copy link

justinotero commented Jan 5, 2017

Same here, my root state is loaded but when I try to access another state I get Error: transition superseded for any and all states.

Angular - 1.3.7
Ang-UI-Router - 0.2.18

Can you guys put your version of angular & ui-router

Once I upgraded to Angular-UI-Router - 0.3.2

Started working fine.

@christopherthielen
Copy link
Contributor

Transition superseded is probably caused by a bug in your code.

A transition is a long running operation (due to async processes, etc). Transition superseded means that there was a transition #1 started and it hasn't yet completed. While it was running, a new transition #2 was also started. Transition #2 supersedes Transition #1. The promise for the transition is rejected with the message "Error: Transition Superseded" so you know the original transition is now aborted.

This is normal behavior if you start a transition, then supersede it with a new transition.


I'm not sure what would print the error message (I don't think we log anything like that in ui-router 0.2.x).

In ui-router 1.0 we have a defaultErrorHandler which logs errors to the console, including Transition Superseded. If you don't want to log Transition Superseded in ui-router 1.0, you should customize the $state.defaultErrorHandler() and filter out errors that look like the Transition Superseded ones.

Closing because this is probably not a bug. However, I'll reopen if a reproduction can be posted that demonstrates a bug.

@joshunger
Copy link

FWIW, I had an old version of angular-ui-router. When I updated angular-ui-router, the issue went away. Did this fix anyone else?

@justinotero
Copy link

justinotero commented Jan 6, 2017

@joshunger I did updated UI-Router and it resolved the issue momentarily, but it came back.

@aneurysmjs
Copy link

it starts to yelling me that when updating my app to angular 1.6.1

@justinotero
Copy link

@blackendstudios Don't update angular, try updating Angular UI Router. I am running Angular 1.3.7 with updated Angular UI Router of 0.3.2 and I am not longer seeing Error: transition superseded

@aneurysmjs
Copy link

@justinotero I fixed it, look!! http://stackoverflow.com/questions/41450712/angularjs-and-ui-router-error-transition-superseded-during-angularjs-unit-te/41515812#41515812

you need to update both angular and the ui-router

@mch24
Copy link

mch24 commented Jan 12, 2017

Just wanted to add to the tally of people who upgraded to AngularJS 1.6.1 and UI-Router 0.3.2 who are consistently getting the "Error: transition superseded" in the console.

@trask
Copy link
Contributor

trask commented Jan 12, 2017

Yeah, I'm getting it also (angular 1.6.1 and ui-router 0.3.2)

@severin2
Copy link

It'd be super helpful if the error message for superseded transitions had information about what transition of fromState->toState collided with what other transition from fromState2->toState2.

@himanshupathakpwd
Copy link

I was using
angular.module('myApp').run(appRun); appRun.$inject = ['$state']; function appRun($state) { $state.go('home'); }
In my app config file. As I removed the logic from app.run, it got fixed.

@christopherthielen
Copy link
Contributor

It'd be super helpful if the error message for superseded transitions had information about what transition of fromState->toState collided with what other transition from fromState2->toState2.

@severin2 UI-Router 1.0 has the $trace service which has those details.

@mhawila
Copy link

mhawila commented Jan 17, 2017

I am getting this with angular 1.6.1 and ui-router 0.3.2. If it is any help I generated the app using mean.io stack version 0.5.5. I know, I know I should probably be shouting at "mean" guys but I figured putting it here may sort of push the issue a bit higher in priorities.

christopherthielen added a commit that referenced this issue Jan 18, 2017
…nsition promise

Now calling `.catch()` on the transition promise

Closes #3246
Closes #2889
@christopherthielen
Copy link
Contributor

See also: #2889 (comment)

0.4.0 release should handle all rejected promises that UI-Router is responsible for including this one.

@christopherthielen christopherthielen added this to the 0.3.3 milestone Jan 18, 2017
@mhawila
Copy link

mhawila commented Jan 18, 2017

When is 0.4.0 coming out?

@Narretz
Copy link

Narretz commented Jan 19, 2017

@mutazabuawad99
Copy link

I had this error today ...
I fixed it by changing the versions of angular.min.js to 1.5.8 and angular-ui-router.js to 0.2.10

@christopherthielen
Copy link
Contributor

0.2.10 release is almost three years old. I do not recommend

@mugwag
Copy link

mugwag commented Jan 31, 2017

I'm also getting this error - is there a way to fix this with Angular 1.6.1?

@himanshupathakpwd
Copy link

@mugwag check my comment above if it's helpful

@panagioths-k
Copy link

try angular version: 1.5.1
and angular-ui-router: 0.2.18 that combination works fine
for example if you are using bower:
bower install angular#1.5.1
bower install angular-ui-router#0.2.18

@gaom25
Copy link

gaom25 commented Feb 10, 2017

I get that error before but i upgrade my angular and ui-router and the error gone.
angular: 1.6.2
ui-router: 0.4.2

@christopherthielen
Copy link
Contributor

The version to be on is either 0.4.2 or 1.0.0-rc.1

@christopherthielen
Copy link
Contributor

try angular version: 1.5.1

1.5.1 doesn't show the error, but that's because logging of rejected promises wasn't added until angular version 1.6.0.

@nblasgen
Copy link

The issue was fixed in UI-Router 0.4.2. Update. See issue #3120

@rguico
Copy link

rguico commented Feb 15, 2017

The promise for the transition is rejected with the message "Error: Transition Superseded" so you know the original transition is now aborted.

I'm OK with aborting the original transition (the logic to go to a different state is legit), but is there a way to "gently abort" the original transition before calling $state.target, so that an error is not produced?

@christopherthielen
Copy link
Contributor

There currently is not a way to do that. Will you please open a separate issue?

@bennettatoms
Copy link

Just wanted to chime in here, because I was getting maddening Transition Superseded errors when I tried to navigate to perfectly valid routes with valid params via traditional means: just clicking through tabs until I got there... but I was always being redirected to my otherwise state. (I was, however, able to directly input the full url and access the state without being redirected.)

Background: I had just upgraded my angular 1.5.8 application from ui-router 0.3.1 to 1.0.0-rc1 and was going through the migration guide and googling around to fix bugs as they arose, and I came across this (admittedly outdated) summary of breaking changes and followed down the path of depending on the ui.router.state.events module to be able to keep the $stateChange events I had been using with the previous version. Soon after I decided to implement proper $transition hooks and cross check that the hooks I put in place were accomplishing the same purpose that the $stateChange events had been doing prior. Satisfied that the hooks were working properly, I removed all the $stateChange event listeners.

HOWEVER, I didn't think to also remove the dependency on ui.router.state.events, and while angular never errored because of the now-unused dependency, there must have been some mischief happening under the hood, because after more than a week of googling in vain, I finally got around to discarding ui.router.state.events from my dependencies, and suddenly I could navigate to the desired states without issue.

I might just be an idiot unicorn, but if there happen to exist more people out there like me, maybe this will save you some time and a fistful of hair.

@swiety85
Copy link

swiety85 commented Apr 19, 2017

I still have issue with thrown exception "Transition superseded" while fast navigating between states without waiting (ui-router 0.4.2 and angular 1.6.4). I solved my problem by changing one line of code.
From this:
function silenceUncaughtInPromise (promise) { return promise.then(undefined, function() {}) && promise; }
To this:
function silenceUncaughtInPromise (promise) { return promise.then(undefined, function() {}); }
I'm not sure what was an intention to return promise without catched error, but there is big chance that all other "unhandled promise rejection" issues will be fixed as well, because this function is a wrapper of any kind of rejecting in ui-router.
Maybe it will help somebody.

@SensationSama
Copy link

SensationSama commented Apr 19, 2017

Take care when performing your update to angular-ui-router.

I called bower update angular-ui-router, but it kept it on the same version.
Performing bower install angular-ui-router completed the update and resolved this issue, for me.

@felipefreitas
Copy link

I followed @SensationSama suggestion and the problem has solved for me. Before, I updated the angular-animate to 1.6.2 version.

Performing bower install angular-ui-router completed the update and resolved this issue, for me.

So, the bower has been like below:
"angular": "1.6.4", "angular-animate": "1.6.2", "angular-ui-router": "0.4.2"

@CatinhoCR
Copy link

Just for the record. I just ran into this same issue, updating ui router to something above 0.3.2 fixes it (or it did for me at least).

@princewck
Copy link

princewck commented Oct 19, 2017

I got the same issue, I solved this by updating to [email protected] .

@MatthiasGwiozda
Copy link

MatthiasGwiozda commented Dec 26, 2017

This happens to me when i open a state directly by opening a page that is registered as a state. For example: http://localhost:9000/#/myURL. When im opening it with a link that is on the page (ui-sref="myURL") then it doesn't show up.
Im using:
"angular-ui-router": "^1.0.12",
"angular": "^1.6.8",

@MatthiasGwiozda
Copy link

The problem was that I was using $state.go in one of my controllers. A solution, that worked for me can be found here: https://stackoverflow.com/questions/42659302/angular-ui-router-1-0-0rc-transition-superseded-on-a-redirect#answer-44654316

@risinghero
Copy link

risinghero commented Apr 27, 2018

I had the same error with the first page load and v0.2.18 of angular-ui-router.
But when navigated from url to url it was okay.
I've found the reason: behaviour of $q.reject changed. In later versions of angular it immediately throws error in console log when you create it. I.e. following lines write erros to console:

var TransitionSuperseded = $q.reject(new Error('transition superseded')); 
var TransitionPrevented = $q.reject(new Error('transition prevented')); 
var TransitionAborted = $q.reject(new Error('transition aborted')); 
var TransitionFailed = $q.reject(new Error('transition failed')); 

I've changed this lines:

var TransitionSuperseded = function () { return $q.reject(new Error('transition superseded')); };
var TransitionPrevented = function () { return $q.reject(new Error('transition prevented')); };
var TransitionAborted = function () { return $q.reject(new Error('transition aborted')); };
var TransitionFailed = function () { return $q.reject(new Error('transition failed')); };

And changed in other lines TransitionSuperseded to TransitionSuperseded().
This fixed errors.

edulix added a commit to sequentech/common-ui that referenced this issue Feb 15, 2020
edulix added a commit to sequentech/common-ui that referenced this issue Feb 27, 2020
* for borda type, question percentage over points

* fix over total valid votes percent

* grunt build

* Go next (#97)

* test extra field for documentation directive

* test

* test

* grunt build

* add sce

* fix npm

* fix locales

* grunt build

* change cookies to enable multiple logins at once

* syntax fix

* grunt build

* fixes

* grunt build

* release 103111.2

* grunt build

* add append to lambda on checker service

* fixes

* grunt build

* change to v3

* grunt build

* adding some minor style changes

* rebuild

* randomice pass field id, set default value to none

* grunt build

* changes have to be on code-field not on password-field

* refactor code/password fields

* grunt build

* make signup link configurable

* rebuild common

* filter required_when_registered extra field on signup

* grunt build

* add extra functions to authmethod

* grunt build

* set grunt-merge-json to 0.9.5 because last version gives problems with chalk (eirslett/frontend-maven-plugin#629)

* change version to go v4

* change version to go v4

* simplify footer

* test

* fix css

* add hook to plugin

* grunt build

* add element to plugin data

* remove element

* refactor

* refactor

* go v5

* grunt build

* add left margin to footer

* grunt build

* change legal

* grunt build

* add target _blank to footer links

* grunt build

* fix doc directive ul css

* grunt build

* add less file, grunt build

* install international phone-number

* grunt build

* test bower

* trying to add components

* img changes

* refactor

* grunt build

* test

* test..

* test

* fixes

* test

* test css

* refactor

* readd intl to bower

* test

* test

* change utils

* test

* dist

* flags

* fixes

* tel country set to auto

* get ip country

* grunt build

* refactor, add tel validation

* grunt build

* change error color, change id to class

* a fix, grunt build

* change id, use it

* grunt build

* revert changes

* grunt build

* test change id

* grunt build

* change id name again

* grunt build

* changes

* grunt build

* revert

* grunt build

* test

* grunt build

* test

* grunt build

* test

* test

* test

* fixes

* fix css, errors

* grunt build

* test

* test

* test

* test

* refactor error, color red

* grunt build

* fix translation

* fix input

* grunt build

* bower angular 1.2

* fix dependencies

* intl dep version

* grunt build

* use full international number

* grunt build

* fix dependencies

* update to v5, grunt build

* grunt build

* fix tel validation check

* grunt build

* change version to go v6

* grunt build

* add tel number value

* grunt build

* show resend when required

* grunt build

* refactor

* grunt build

* refactor

* grunt build

* add email to valid resend auth code

* grunt build

* allow email resend

* fix syntax, grunt build

* fix disabled when clicked resend auth

* grunt build

* fix email getter issue

* grunt build

* trying to fix error

* fix syntax

* grunt build

* refactor

* grunt build

* refactor

* grunt build

* change version to go v7

* grunt build

* add get/save draft el

* grunt build

* change version to go v8

* grunt build

* adding initial support for activity log

* rebuild

* adding support for advanced filtering in activity log

* fixing typo

* build

* fixing typo

* build

* fix get activity page

* rebuild

* Action comments (#85)

* Added comment optional for activate/deactivate user ids

* rebuild

* set lang in html tag

* grunt build

* increase contrast

* grunt build

* add aria label to foot links

* grunt build

* fix lang buttons keyboard accessibility

* grunt build

* refactor to ng-space-click directive

* css fixes

* grunt build

* fix ng-space-click

* grunt build

* Added avrDateField directive to show a datepicker (#86)

* Added avrDateField directive to show a datepicker

* field name in avrDateField as label

* fix color contrast on text warning

* grunt build

* Tally sheets (#88)

* adding ballot boxes support

* rebuilding

* adding support for creating ballot boxes

* rebuild

* fix params in create ballot box

* rebuild

* adding modal-text-success

* rebuild

* adding support for deleting ballot boxes

* rebuild

* fixing modelline

* adding support for adding tally sheets

* adding support for getting tally sheets

* adding support for delete tally sheets

* increase contrast

* grunt build

* moar contrast

* grunt build

* fixes

* email-and-password and user-and-password as login methods (#87)

* fix lang css

* grunt build

* fixes

* Census query (#89)

* initial work on census query

* rebuild

* set cookie path to base

* grunt build

* fixes

* Fix date field (#92)

* adding it to the list

* rebuild

* adding some styles

* rebuild

* adding more vertical spacing to the date field

* adding model binding

* rebuild

* improving looks of the census query

* rebuild

* rebuild and success in green

* Census accessible (#94)

* fix date

* grunt build

* fixes

* fix aria labels for fields

* grunt build

* fixes

* grunt build

* fixes

* grunt build

* fixes

* rebuild

* update gl i18n

* rebuild

* Enre 1 (#95)

* fixing dni

* fixing dni

* rebuild

* fix login redirect after signup

* adding a default country code and making it easier to find

* Fix reorder options (#96)

* fixing some gl i18n

* updating dnd library

* using latest dnd list lib version

* update config version

* updating some depencencies and old versions (#98)

* updating some depencencies and old versions

* update version

* merge

* updating version config

* updating helsinki theme to improve visibility of booth search box

* adding email-otp

* building

* fix template

* using underscore contains instead of in keyword

* update otp help

* change email placeholder

* fix typo error

* starting to use yarn

* bumping version

* ifinally making nanoscroller import correctly in grunt build

* moving all dependencies to devDependencies really

* update readme to use yarn instead of npm or bower

* removing dependencies from bower

* changing package version

* making it compile

* compiled

* adding missing files

* using specific version of i18next

* add missing files from dist and correct link to autofocus lib

* adding autofocus to the build

* adding the other autofocus

* updating angular cookies

* updating angular-animate to match angular version

* updating angular-sanitize and angular-resource versions to match angular version in use

* updating ui router to try prevent this issue angular-ui/ui-router#3246

* migrating code to use  then instead of success and error functions, because new angular version deprecated that

* migrating code to use  then instead of success and error functions, because new angular version deprecated that

* testing old version of angular to see if it works

* remove duplicated angular-bootstrap/ui-bootstrap declarations

Co-authored-by: Félix Robles <[email protected]>
@vituchon
Copy link

vituchon commented Feb 1, 2022

Transition superseded is probably caused by a bug in your code.

A transition is a long running operation (due to async processes, etc). Transition superseded means that there was a transition #1 started and it hasn't yet completed. While it was running, a new transition #2 was also started. Transition #2 supersedes Transition #1. The promise for the transition is rejected with the message "Error: Transition Superseded" so you know the original transition is now aborted.

This is normal behavior if you start a transition, then supersede it with a new transition.

I'm not sure what would print the error message (I don't think we log anything like that in ui-router 0.2.x).

In ui-router 1.0 we have a defaultErrorHandler which logs errors to the console, including Transition Superseded. If you don't want to log Transition Superseded in ui-router 1.0, you should customize the $state.defaultErrorHandler() and filter out errors that look like the Transition Superseded ones.

Closing because this is probably not a bug. However, I'll reopen if a reproduction can be posted that demonstrates a bug.

But how doy explain that making this changes, the error "disappears"

@chris-chapin
Copy link

I upgraded the following and all the error messages went away.

angular from 1.6.0 to 1.8.3
angular-ui from 0.2.18 to 0.4.3 (hit a breaking change going to v1 and haven't investigated it yet)

Those upgrades solved 1 error sequence.

The final error sequence was solved upgrading ui-bootstrap from 1.2.5 to 2.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests