-
Notifications
You must be signed in to change notification settings - Fork 26
angular2-jwt / SystemJS load issue #13
Comments
I'm having essentially the same problem. I've tried a few different things but they all result in
if you try and define two packages it comes out of
If i get rid of those paths in the package format which look nasty anyway
Now i get When you try and load it in using the |
You can try mapping directly to System.config({
defaultJSExtensions: true,
packages: {
app: {
format: 'register',
defaultExtension: 'js'
},
},
map: {
"angular2-jwt": "node_modules/angular2-jwt/angular2-jwt.js"
}
});
System.import('app/main').then(null, console.error.bind(console)); Let me know if that works for you. Also, don't forget to bring in |
Hi @chenkie The snippet above is not working. My code is following angular.io official Tour of Heroes setup in using Systemjs. Added your snippet and also http.dev.js Also those that @set321go have tried, I tried too. It doesn't work yup. Could you build a quickstart Angular.io TOH (https://angular.io/docs/ts/latest/quickstart.html) and add Auth0 login to it? |
Made some progress this morning I pulled down
then my main.ts
my Auth0Service.ts
This works. The problem seem's to be |
What error does it give you if you uncomment |
Our favourite!
|
Which is really weird because |
Hi @chenkie Thank you for looking into this. @set321go and I are having the same problem despite many tries.
Our favourite error message. @set321go I updated my project to ng2 beta 3 zone 5.11. Thanks for pointing this out. I missed it. @chenkie my Tour of Heroes repo with Auth0 can be found here https://github.com/choopage/angular2-tour-of-heroes/tree/auth0 Could you lend me a hand by understanding why Auth0 and TOH aren't going together in that repo? Cheers, |
Ok so i got it working. It seems the problem was the import statement. I was just using intellij's auto import without really paying it much attention, seems that's where the problem was. So using the system.config setup posted above.My
Then my
The important part for me was |
Thanks @set321go. @choopage, does this work for you? I'm going to put together a sample for this because I'm not sure why it's requiring that you use angular2-jwt/angular2-jwt. You shouldn't need to import like that. |
Hi @set321go I have some questions that I hope you could help me.
Wouldn't you run into issue without having this
Hi @chenkie I have couple of questions that I hope you could help me.
What is that above doing
Any best practices to recommend for managing Auth0 tokens when collaborating? Cheers |
The client token in
In the The The I'm not certain about the |
The Auth0 client ID is indeed a public token, but this is fine since anyone would be able to see it when they view source on your app. Your Auth0 secret token is the important one to keep hidden on your backend and is what is used to check your JWTs to make sure they're legit. |
What causes those warnings? I have not seen it in the browser console. |
If you take out That line is there to avoid |
@chenkie and @set321go thank you for helping with this issue. index.html
main.ts
|
I am having the same issue - I have Auth0 working in the sample project but when I try to include it in my project, I get the same error
I tried to clone the git repo included above (https://github.com/choopage/angular2-tour-of-heroes/tree/auth0), but when I do npm start, I get the same unexpected token errors. @chenkie, you said in one of the comments that you were going to put together a sample... do you have a repo on github or somewhere I could look at it? |
I'm waiting for Auth0 to provide a complete tutorial on using Auth0 with angular.io TOH :) Hope your issue is solved @jbuechs |
I haven't forgotten about this :) I'll touch base next week. |
Hi all, my apologies that this took a long time. I finally have the authentication demo based on Angular 2 Tour of Heroes: https://github.com/auth0-blog/angular2-tour-of-heroes Please let me know if you have any questions :) |
if i don't do 'import {service} from "angular2-jwt/angular2-jwt", i keep getting 403 forbidden errors. Now I keep getting "no value accessor for ''" errors |
I have the below configuration in my system-config.ts /***********************************************************************************************
/** User packages configuration. */ ////////////////////////////////////////////////////////////////////////////////////////////////
const cliSystemConfigPackages: any = { barrels.forEach((barrelName: string) => { /** Type declaration for ambient System. */ // Apply the CLI SystemJS configuration. // Apply the user's configuration. And I import from angular2-jwt as below import { AuthHttp, tokenNotExpired } from 'angular2-jwt'; But I get the below error: Error loading http://localhost:4200/node_modules/angular2-jwt/angular2-jwt.js as "angular2-jwt" from http://localhost:4200/app/signup/signup.component.js ; Zone: ; Task: Promise.then ; Value: Error: Error: XHR error (404 Not Found) loading http://localhost:4200/node_modules/angular2-jwt/angular2-jwt.js(…) |
Hello everyone, for days I am trying to solve the same problem and I do not get it, after following the steps indicated in the instruction (https://auth0.com/blog/creating-your-first-real-world-angular-2-app-from-authentication-to-calling-an-api-and-everything-in-between/), I throw the following error: SyntaxError: Unexpected token < Someone found the solution? I would greatly appreciate your help! |
sorry i dont konw how to use |
Hi @chenkie
I'm attempting to use Auth0 with my new Angular2 project. I'm new to SystemJS.
I'm following your example auth0-angular2. My new project is like Angular.io Tour of Heroes.
Here is the problem: My module angular2-jwt couldn't load. I couldn't use it in my
main.ts
.Choopage's System.JS config
![choopage](https://cloud.githubusercontent.com/assets/6467136/12864403/5a32178e-ccc4-11e5-95c7-ab2c2373ad53.png)
Chenkie's System.JS config
![chenkie](https://cloud.githubusercontent.com/assets/6467136/12864408/62fc357a-ccc4-11e5-8e8b-f105bbee59fc.png)
I can do it like yours example but my TOH app would fail.
So what should I do to make my SystemJS right so I can use Angular2-JWT?
Or do you have an example of Angular.io's TOH using Auth0?
The text was updated successfully, but these errors were encountered: