This repository has been archived by the owner. It is now read-only.

Possible uglification/build issue with Lock initialization #107

Closed
rolodato opened this Issue Nov 5, 2014 · 7 comments

Comments

Projects
None yet
5 participants
@rolodato
Contributor

rolodato commented Nov 5, 2014

App fails to initialize on IE10 when using auth0-angular 3.0.5 and Lock 6.4.0 with the following error:

SCRIPT5022: [$injector:modulerr] Failed to instantiate module app due to:
Error: `ClientID` required as first parameter.

Edit:

Seems to happen in all browsers when an uglification/bower build task is run. The repository in concern is this:
https://github.com/avalanche-canada/ac-web

@rolodato rolodato added the bug label Nov 5, 2014

@whyvez

This comment has been minimized.

Show comment
Hide comment
@whyvez

whyvez Nov 6, 2014

I'm getting this issue in Chrome 38. Works fine in dev but blows chunks in prod. Difference being dev uses your build straight out while prod concats and minifies. Using auth0-angular 3.0.5 and Lock 6.4.0.

whyvez commented Nov 6, 2014

I'm getting this issue in Chrome 38. Works fine in dev but blows chunks in prod. Difference being dev uses your build straight out while prod concats and minifies. Using auth0-angular 3.0.5 and Lock 6.4.0.

@cristiandouce

This comment has been minimized.

Show comment
Hide comment
@cristiandouce

cristiandouce Nov 8, 2014

Contributor

As noticed here: auth0/lock/blob/093f8cd30b8877e9edecee33227ffa57b6c00671/index.js#L63

That error only throws when missing the clientid or providing a wrong type.

The minification task might be messing up with function parameters or something. It may be worth cheching with another minifcation tool.

Or maybe a variable remains undefined in scope when concatenating stripts.

Contributor

cristiandouce commented Nov 8, 2014

As noticed here: auth0/lock/blob/093f8cd30b8877e9edecee33227ffa57b6c00671/index.js#L63

That error only throws when missing the clientid or providing a wrong type.

The minification task might be messing up with function parameters or something. It may be worth cheching with another minifcation tool.

Or maybe a variable remains undefined in scope when concatenating stripts.

@cristiandouce cristiandouce changed the title from Lock constructor error on IE10 and below to Possible uglification issue with Lock initialization Nov 9, 2014

@cristiandouce

This comment has been minimized.

Show comment
Hide comment
@cristiandouce

cristiandouce Nov 9, 2014

Contributor

I was able to reproduce the issue of this application in concern: https://github.com/avalanche-canada/ac-web.

I was able to reproduce it by removing from the index.html the bower_dependencies of auth0-js, auth0/angular-store, auth0-angular and auth0-lock.

Then remove the ignore from this line https://github.com/avalanche-canada/ac-web/blob/dev/Gruntfile.js#L222

Forcing there to include the libs via bowerInstall task.

Run grunt serve.

And when the browser opens the error should pop in the developer tools console.

@whyvez Correct me if I'm wrong. Thanks!

Contributor

cristiandouce commented Nov 9, 2014

I was able to reproduce the issue of this application in concern: https://github.com/avalanche-canada/ac-web.

I was able to reproduce it by removing from the index.html the bower_dependencies of auth0-js, auth0/angular-store, auth0-angular and auth0-lock.

Then remove the ignore from this line https://github.com/avalanche-canada/ac-web/blob/dev/Gruntfile.js#L222

Forcing there to include the libs via bowerInstall task.

Run grunt serve.

And when the browser opens the error should pop in the developer tools console.

@whyvez Correct me if I'm wrong. Thanks!

@cristiandouce cristiandouce changed the title from Possible uglification issue with Lock initialization to Possible uglification/build issue with Lock initialization Nov 9, 2014

@whyvez

This comment has been minimized.

Show comment
Hide comment
@whyvez

whyvez Dec 14, 2014

Worked on this a bit today. Tried many things but the one change which seemed to have worked is re-building lock.js with only the english i18n module. Seems like some characters in other languages is throwing something off. It would also be nice to be able to load these i18n dics separately than the main module somehow. Aside from the possibly breaking the some app build processes it adds extra data for those who don't really need it. Although I'm pretty sure this was the general root cause I'm not sure the finite details of what part of the fix was blowing chunks. For now I'm going to take lock.js out of my build process and serve as is. Might be worth moving this issue back to lock.js since auth0-angular seems fine in my case anyways.

whyvez commented Dec 14, 2014

Worked on this a bit today. Tried many things but the one change which seemed to have worked is re-building lock.js with only the english i18n module. Seems like some characters in other languages is throwing something off. It would also be nice to be able to load these i18n dics separately than the main module somehow. Aside from the possibly breaking the some app build processes it adds extra data for those who don't really need it. Although I'm pretty sure this was the general root cause I'm not sure the finite details of what part of the fix was blowing chunks. For now I'm going to take lock.js out of my build process and serve as is. Might be worth moving this issue back to lock.js since auth0-angular seems fine in my case anyways.

@kevinob11

This comment has been minimized.

Show comment
Hide comment
@kevinob11

kevinob11 Dec 23, 2014

Any news on this? I'm seeing the same thing when I minify and uglify using gulp.

kevinob11 commented Dec 23, 2014

Any news on this? I'm seeing the same thing when I minify and uglify using gulp.

@mgonto

This comment has been minimized.

Show comment
Hide comment
@mgonto

mgonto Dec 23, 2014

Member

I've moved this issue to Lock repository. Please continue there.

We'll take a look

Member

mgonto commented Dec 23, 2014

I've moved this issue to Lock repository. Please continue there.

We'll take a look

@rolodato

This comment has been minimized.

Show comment
Hide comment
@rolodato

rolodato Aug 6, 2015

Contributor

auth0/lock#94 was closed, so closing this issue too.

Contributor

rolodato commented Aug 6, 2015

auth0/lock#94 was closed, so closing this issue too.

@rolodato rolodato closed this Aug 6, 2015

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