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

The minified release gives an error #692

Closed
Guuz opened this issue Dec 17, 2013 · 11 comments
Closed

The minified release gives an error #692

Guuz opened this issue Dec 17, 2013 · 11 comments

Comments

@Guuz
Copy link

Guuz commented Dec 17, 2013

When i use the unminified version everything works fine. But for the production version of my app i use the minified release v0.2.7.
As soon as i swap the unminified with the minified release i get this (unreadable) error:

Error: [$injector:unpr] http://errors.angularjs.org/1.2.3/$injector/unpr?p0=dProvider%20%3C-%20d
    at Error (<anonymous>)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js:6:449
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js:32:320
    at Object.c [as get] (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js:29:461)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js:32:388
    at c (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js:29:461)
    at d (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js:30:130)
    at Object.instantiate (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js:31:284)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js:62:112
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js:49:117 

I know the error means that it couldn't find a provider for dependency injection. But i have no idea which one because the file is minified. Maybe someone else has more insight in this?

It probably also has something to do with how i'm using the router because it doesn't happen at every state, but at some. Still its a ui-router bug because my code works when using the unminified release. I'm probably hitting a specific code path that has a bug/isn't minified correctly.

@timkindberg
Copy link
Contributor

Something may not be annotated...

@mntnoe
Copy link

mntnoe commented Dec 20, 2013

It happens when using ui-sref-active. See this plunk: http://plnkr.co/edit/XWOlRK

@Guuz
Copy link
Author

Guuz commented Dec 20, 2013

That makes sense! I have added that recently. Any known fix?

@ValLisetsky
Copy link

It looks like controller injection was not done correctly for $StateActiveDirective in line 1650:

Currently:
controller: function($scope, $element, $attrs) {
...
}

Should be:
controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {
...
}]

I'm new to ui-router, so cannot say for sure that my fix not introducing any new issues. But it solves minification issue and ui-sref-active directive looks working.

@Guuz
Copy link
Author

Guuz commented Dec 23, 2013

Great! Thanks @ValLisetsky!

@blowsie
Copy link

blowsie commented Jan 7, 2014

Has a commit been made for this?

@Guuz
Copy link
Author

Guuz commented Jan 7, 2014

Not sure actualy. #671 looks like it.

@tomchentw
Copy link

Suck half day on it... wtf??
Please update /release folder to reflect on this change.

@timkindberg
Copy link
Contributor

Would PR #725 fix this?

@nateabele
Copy link
Contributor

Duplicate, see #671.

@inetfuture
Copy link

Suck half day on it... wtf??

me too, I have to tear down my app piece by piece to figure out which part is causing this, anyone have good idea about how to debug this kind of issue? Currently I learned that I should test my app in production mode ASAP

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

No branches or pull requests

8 participants