Skip to content

Conversation

@mikecarroll
Copy link
Contributor

When I minified the code, the following error is thrown: Uncaught Error: [$injector:unpr] Unknown provider: tProvider <- t <- ExpiredInterceptor <- $http <- $compile

This is due to the minification process, which is ruining the dependency injection. (Some background on this error here: https://coderwall.com/p/eeqo7q/debugging-unknown-provider-error-in-angular)

This PR simply uses strings to prevent these errors, as recommended in the link above. I also made some spacing adjustments for legibility (which is why the diff looks like nearly the whole file was changed.)

Works great for me when minified with these changes.

@andreareginato
Copy link
Collaborator

It's a really strange behaviour. Actually the grunt file has a task that takes care of this and add the needed code. Even more, I've never had this kind of problem. Anyway, I'll accept the pull request. Thanks a lot @mikecarroll.

andreareginato added a commit that referenced this pull request Nov 29, 2014
Change dependencies to strings to prevent minification failures
@andreareginato andreareginato merged commit 097e9b3 into angularjs-oauth:master Nov 29, 2014
@mikecarroll
Copy link
Contributor Author

Thanks!

Yeah, I thought it was strange, too. It might be an issue with the way that I'm doing minification (this is being built with a Rails project and I let Rails handle minification) but, for what it's worth, I've noticed that other Angular modules practice this as well: https://github.com/angular-ui/ui-utils/blob/master/modules/jq/jq.js#L20

An alternative idea: If Grunt can successfully handle this on your end, you could just revert the commit and push a pre-minified oauth-ng.min.js with each new version.

@mikecarroll
Copy link
Contributor Author

@andreareginato Weird, did it get overwritten? Or did you decide not to use it and rolled it back?

@andreareginato
Copy link
Collaborator

I guess it went overwritten from another pull. Could you please send it
once more? Many thanks.
Il 30/nov/2014 00:29 "Michael Carroll" notifications@github.com ha
scritto:

@andreareginato https://github.com/andreareginato Weird, did it get
overwritten? Or did you decide not to use it and rolled it back?


Reply to this email directly or view it on GitHub
#58 (comment)
.

mikecarroll added a commit to mikecarroll/oauth-ng that referenced this pull request Nov 30, 2014
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

Successfully merging this pull request may close these issues.

2 participants