Skip to content
This repository has been archived by the owner on Sep 20, 2020. It is now read-only.

Angular 1.6, "Error: transition prevented" #356

Open
exchsac opened this issue Dec 27, 2016 · 21 comments
Open

Angular 1.6, "Error: transition prevented" #356

exchsac opened this issue Dec 27, 2016 · 21 comments
Milestone

Comments

@exchsac
Copy link

exchsac commented Dec 27, 2016

Since the angular 1.6.x releases dsr still seems to work but I get a nasty console message :
http://codepen.io/exchsac/pen/jVjGBJ

"Error: transition prevented $get@https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.2/angular-ui-router.js:2912:75 invoke@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:4842:24 $get@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:4709:49 invoke@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:4842:24 $get@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:4709:49 invoke@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:4842:24 $get@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:4709:49 invoke@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:4842:24 https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:4636:43 getService@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:4783:39 https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.2/angular-ui-router.js:3696:20 invoke@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:4842:24 https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:4645:68 forEach@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:357:24 createInjector@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:4645:10 doBootstrap@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:1838:34 bootstrap@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:1859:23 angularInit@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:1744:14 https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:32977:16 trigger@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:3314:7" "Possibly unhandled rejection: {'line':2912,'column':75,'sourceURL':'https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.2/angular-ui-router.js'}"

@liangtongxie
Copy link

i also have this problem....

@chris-eaton
Copy link

chris-eaton commented Jan 4, 2017

If you upgrade to version UI Router 0.3.2 it fixed this for me

@gigmaps
Copy link

gigmaps commented Jan 6, 2017

yes see issue #354 and pull request #355
due to an outdated bower.json ui-router-extras currently limits ui-router to version 0.2.18
@christopherthielen could you please have a look at PR #355 to get this sorted ?

@exchsac
Copy link
Author

exchsac commented Jan 6, 2017

hmm... the example provided does use angular-ui-router v0.3.2 (look at the error message I pasted, second and last line), I don't see how bower.json is relevant here (btw. wouldn't the next ui-router-extras release be >0.1.3 ?).

@nijat12
Copy link

nijat12 commented Jan 6, 2017

+1

@BeerPoldet
Copy link

I'm also get this error. Does this matter? Can i just ignore it?

@anzorb
Copy link

anzorb commented Jan 14, 2017

Getting this error with the following setup:

├── angular#1.6.1
├── angular-ui-router#0.3.2
├── ui-router-extras#0.1.3

@nick-adriaenssens
Copy link

+1

@BjornRombaut
Copy link

We are also experiencing the same problem using:

@BjornRombaut
Copy link

@christopherthielen I created a PR that resolves this issue, Im not 100% sure that it is the correct solution. Can you check and give feedback? Thanks

@thinkdj
Copy link

thinkdj commented Jan 26, 2017

Use the latest version and it will be gone. I had the same problem and spent time figuring out what I did wrong. Thanks, @chris-eaton for the direction.

@goleafs
Copy link

goleafs commented Feb 3, 2017

the error is not gone if you are using ct-ui-router-extras, at least in some circumstances.

however, I found making this change in ct-ui-router-extras resolves it... but I am not sure what other implication this may have.

any idea? @christopherthielen?
line 1211 - changed as follows...

                    //return $q.reject(err);
                    return err;

@krimark
Copy link

krimark commented Feb 3, 2017

Can confirm that using ct-ui-router-extras 0.1.3 together with ui-router 0.4.2 and angular 1.6.1 causes this. I was going nuts trying to find out what was causing it, thank's for spotting it goleafs. Removing return $q.reject(err); also seems to do the trick for me.

@N0NamedGuy
Copy link

I figured out that this happens because of this: angular/angular.js#14631

Another workaround, to restore the old behaviour (while a fix lands on ui-router-extras) is to disable the reporting of unhandled rejections, by setting this on a config block, on your applications:

angular.module('myapp').config(function ()
  // Disable reporting of unhandled rejections
  $qProvider.errorOnUnhandledRejections(false);
});

This is just a band-aid!

https://docs.angularjs.org/api/ng/provider/$qProvider

@Delan60
Copy link

Delan60 commented Mar 16, 2017

+1

@renandegrandi
Copy link

i have the same problem

Angular 1.6.4
ui.router 0.4.2
ui-router-extras 0.1.3

@christopherthielen christopherthielen added this to the 0.1.4 milestone May 4, 2017
@fborges42
Copy link

fborges42 commented Jul 26, 2017

got this problem also...
angular v1.6.7
ui-router v1.0.5

no ui-router-extras

$qProvider.errorOnUnhandledRejections(false); is not working in my case..

Edit:
Ended up correcting the problem.
I was using the popover directive from angular-ui-bootstrap 0.13.3 (totally deprecated) with popover-popup-delay wich was causing the problem.
Solution:
Upgrade library or control timeout from the controller.

@aaronpikkarainen
Copy link

I found that the below work around has a bad side-effect where real javascript errors are sometimes not making it to the console. This means silent errors can happen (yikes!).

$qProvider.errorOnUnhandledRejections(false);

Does anyone have a better, trusted solution that removes the "transition prevented" error message, but doesn't affect other errors?

@tracyalison11
Copy link

I had all these same errors and attempted to fix by updating. My issue was resolved by removing a $location.hash statement in my controller.

@DavideCordella
Copy link

DavideCordella commented Jan 7, 2019

Anybody managed to fix the issue without other updates?
I have the following configuration:
├── [email protected]
├── [email protected]
└── [email protected]

@aaronpikkarainen
Copy link

I found that I could fix the issue with a small change to ct-ui-router-extras.dsr.js (see attached screen shot). The idea came from this similar fix from Christopher -> angular-ui/ui-router@66ab048
code change

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

No branches or pull requests