Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Dependency issue when using UI-Router 0.3 #202

Open
robertjd opened this issue Jan 18, 2017 · 5 comments
Open

Dependency issue when using UI-Router 0.3 #202

robertjd opened this issue Jan 18, 2017 · 5 comments
Assignees

Comments

@robertjd
Copy link
Member

Upgrading UI-Router to 0.3 causes this exception in our code, if UI-Router is listed before stormpath in the module dependencies:

angular.js:4442 Uncaught Error: Unrecognised token store: localStorage
    at Object.getTokenStore (stormpath-sdk-angularjs.js:3394)
    at new StormpathOAuthToken (stormpath-sdk-angularjs.js:2322)
    at StormpathOAuthTokenProvider.$get (stormpath-sdk-angularjs.js:2476)
    at Object.invoke (angular.js:4478)
    at angular.js:4295
    at getService (angular.js:4437)
    at Object.invoke (angular.js:4469)
    at Object.enforcedReturnValue [as $get] (angular.js:4330)
    at Object.invoke (angular.js:4478)
    at angular.js:4295

Reproduction in the head of this branch:

stormpath/express-stormpath-angular-sample-project@66f5ed2

@oldskool73
Copy link

I just found this service today, and immediately hit this same issue running through the intro guide.

Moving the UI Router below the Stormpath entries in the App DI array (as per your comment in the link above) does NOT fix it for me, it actually has to be moved to the VERY TOP of the array, above any and all other modules.

It also didn't work when downgrading to UI-Router 0.2.8, exactly the same issue, so perhaps it's not an issue with UI-Router 0.3 at all, but with your code somewhere else?

@the-overengineer
Copy link

I suspect it was an error due to the order .run blocks were being executed. Since .config is not an option due to using $q, I just made the the token store initialisation lazy, so it runs when needed, not when the StormpathOAuth service is created. No longer getting the issue after that.

@mgruel
Copy link

mgruel commented Feb 3, 2017

Is there a timeline, when this fix will be available?

@kevinch
Copy link

kevinch commented Feb 15, 2017

Issue confirmed even on ui-router 0.4.2 and angular 1.6.1 with only ui-router, stormpath and stormpath.templatesas dependencies.

@mikeymco
Copy link

mikeymco commented Feb 22, 2017

Moving 'ui-router' to a position after 'stormpath' in my module DI array resolved this issue for me. (Angular 1.6.2, ui-router 1.0.0-rc.1)

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

No branches or pull requests

6 participants