-
Notifications
You must be signed in to change notification settings - Fork 555
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
Webpack #54
Comments
You have to download the release from github and require |
I'd rather require and build it through webpack. I added these loaders to my webpack config: |
I had a few issues with the json especially due to trailing commas being invalid json or duplicate keys making other riles invalid json5 (ru.json specifically). Anyway it would be awesome if it was a little easier to use with webpack out of the box |
I'm not familiar with webpack, but it looks like require.js/AMD. I don't think you will be able to do that because we've used in this project Browserify/NPM, which means that:
So, there are three ways to use this module:
In 1 the library is build in the target application, in 2 and 3 you use the already built in artefact. I've explained my approach to this very same issue here: |
I actually have it working. Webpack uses commonjs and is very much like browserify (it even has a browserify transform). Its just a bit non trivial to get up and running. It would not be hard to get it loading in webpack by default, but if anyone else asks you can tell them about the loaders I used above. |
Awesome! So glad to hear that, Is there something we can do on our side to improve the experience besides maybe a wiki/readme entry? |
Apart from fixing the trailing coma's in the translation json you could I can make a wiki entry and submit a PR for those issues |
That would be very much appreciated! The wiki is public so you can create a document whenever you want. |
This relates to auth0#54, because most of the other translations require json5-loader for this project to be built with webpack (browserify alternative). Another idea would be to fix the trailing commas in some of the other translations so they could be loaded with json-loader (which supports duplicate keys).
I had to modify @nelix proposed fix slightly to get this to work. In particular, I had to add an end of line anchor to the regex, i.e, "test: /.json$/", to keep files like "/auth0-js/lib/use_jsonp.js" from being picked up in the webpack build. Everything else worked perfectly. |
I can't get above example to work with webpack. Anyone have a complete working example? |
I also cannot get the above to work. |
I'm also having problems with this. Did anybody get it right? I'm getting json errors. |
Can you guys try with Thanks a bunch |
@jfromaniello Do you have an example how the webpack file should look? |
@jfromaniello I would also like an example please. I tried again today with v7.5.4 but did not succeed. I'm not sure if this is still the same issue - I am trying to use Lock with angular and am now getting an error from auth0-angular:
I see that auth0-angular throws that error if window.Auth0Lock is not defined. I have tried including the library in a couple of ways:
|
|
@cristiandouce I don't see a build directory in this repository. I am using auth0-angular 4.0.4. |
https://github.com/auth0/lock/tree/v7.5.4/build The build directory is never pushed to master branch or any development branch, just the releases branches. What is important is that if you installed lock with bower you should find that build inside your code. |
@cristiandouce: ah, that explains it. I'm not using bower anymore. I am installing with npm, but I still want to get the build code. |
You should still have that build directory from npm install. Is that not the case? |
no |
@kpgarrod @cristiandouce the If you want to install with npm and at the same time have the build folder in the release tag you can use this and install from github:
|
no that doesn't work either because is npm ignored :( |
@jfromaniello: so any solution for this issue? I have been loading from cdn but the performance is sometimes very slow from where I am. That is making it difficult for me to work. |
@kpgarrod can you try like this:
|
@kpgarrod btw, regarding this:
where are you from? (country) |
South Africa |
I tried installing from that url. I certainly do get the build directory that way, however it still doesn't work for me. Webpack gives me this warning:
and when I run the app I get this angular error: In my limited experience, that usually means there is no |
@jfromaniello I made pull requests for auth0-jwt, auth0-storage and auth0-angular to include an export statement like this:
That seems to be how other libraries deal with this issue. My pull requests haven't been accepted, but I am successfully using my branch in my app. I think the same thing is needed here. I wasn't sure where to add the statement in this library, so haven't made a pull request here, but it would be great if you could add the export to this and your other libraries. |
@kpgarrod I'll look into that. In addition to that, I want to point out that we made a successful change to our cdn and we added a node to South Africa. We will love to know the response time from your place to cdn.auth0.com now. If you dig/nslookup cdn.auth0.com this is the ip it should be resolving: 41.185.31.164. Thanks a lot for your troubleshooting |
@jfromaniello the cdn does resolve correctly and ping time is about 12ms, thanks! |
@kpgarrod @cancan101 @nelix @rayvace @carnevalle we have now an example using webpack in this repository. Unless it doesn't work for you, I'm closing this issue for now. You can follow the instructions here: https://github.com/auth0/lock/tree/master/examples/webpack#running-the-example |
@cristiandouce Unfortunately this is still not working for me. I can get my app to build and basically run by requiring lock like this:
when I try to signin with Lock, I get an error message about I had a message from Gonto to say that the other libraries have already been updated, but I don't see that and am still having issues with them(auth0-angular, auth0-storage and auth0-jwt) - maybe not all of them, I haven't had time to debug properly. It would really help if there was an example angular/webpack app including all four libraries :) |
We dont have auth0-angular in the example... Doesthe example with webpack under thr rxamples folder work for you? If it does then we can scale the issue to debug auth0-angluar instead of lock. |
@cristiandouce yes, the example works correctly for me. |
@kpgarrod cool then. Would you mind open an issue there then, with more detail on your configuration for using webpack with auth0-angular? Also, if you have a seed project that reproduces the bug it would help to debug. |
Updated the lock.podspec and podfile.lock
I tried to load this using webpack but I did not very very far due to not knowing what loaders it would require...
Any advice?
The text was updated successfully, but these errors were encountered: