userapp-io / userapp-angular

AngularJS module that adds user authentication to your app with UserApp.
https://userapp.io
MIT License
233 stars 84 forks source link

Minification breaks userapp-angular #11

Open johanbuys opened 10 years ago

johanbuys commented 10 years ago

Hi,

After a lengthy debugging session on my own app I was able to isolate a problem I was having to the UsesApp-Angular module.

To try and proof that it was not my code I used the example app code from this repo and the same issue occurred.

The Issue: When you minnify and combine js sources angular moans about "Unknown Provider"

My Setup:

Using Gulp I minify and combine the example using gulp-useref and gulp-uglify then start the app using gulp-connect. The App fails with the standard angular provider error:

Uncaught Error: [$injector:unpr] Unknown provider: eProvider <- e http://errors.angularjs.org/1.2.3/$injector/unpr?p0=eProvider%20%3C-%20e

From my experience this is mostly caused by the injector, which is unable to find the module to inject, when a minifier changes variable names and thus changes the name the injector will search for, usually this is easily solved by using the array syntax when defining controllers, services and the like ie

  angular.controller('contr',['$scope',function($scope){}]);

Unfortunately up to now I am still unable to find the erroneous module. Been spending a few days on this now. Hope some one can help with this. I will try and continue to find out what the issue might be.

madecostore commented 9 years ago

Hi! Same issue for me with yeoman grunt build.

ghost commented 9 years ago

Same issue here with gulp. Is this going to be fixed?

luigiw commented 9 years ago

I had the same problem, fixed it with below code.

myApp.run(['user', (user)-> user.init( appId: '12345' ) ])

jgangemi commented 8 years ago

a year later and crickets

viniciussalvati commented 8 years ago

@jgangemi my pull request fixes this. All they needed to do was merge it. You can use my fork if you want.

jgangemi commented 8 years ago

yeah - that's what i'm about to do. i'm just annoyed that they can't integrate this into the main line, it's been over a year.

viniciussalvati commented 8 years ago

The lastest update to the repository was over a year ago. I wonder if they're interacting on the other issues.

Tbh I had one (horrible) experience using UserApp and stopped using it since then, and don't plan on returning.

jgangemi commented 8 years ago

what did you do for an alternative?

viniciussalvati commented 8 years ago

@jgangemi We started using Auth0 where I work. At least they seem to keep their plugins updated and working

jgangemi commented 8 years ago

@viniciusmelquiades thanks! i came across them yesterday as well and will be dropping userapp, especially after i kept getting constant errors on their website last night trying to do some things.

viniciussalvati commented 8 years ago

@jgangemi they have some very cool features, even for free users. I'm glad I could help