Skip to content
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

Unexpected token < #35

Closed
patrickreck opened this issue Feb 14, 2016 · 3 comments
Closed

Unexpected token < #35

patrickreck opened this issue Feb 14, 2016 · 3 comments

Comments

@patrickreck
Copy link

I am trying to use angular2-jwt. However I am getting the following error when trying to use it:

Uncaught SyntaxError: Unexpected token <
    Evaluating http://localhost:3000/angular2-jwt/angular2-jwt
    Error loading http://localhost:3000/app/main.js

I've followed the example, so my guess is that I am somehow failing to import it correctly.

It's included in my index.html <script src="node_modules/angular2-jwt/angular2-jwt.js"></script>

I've imported it to my app component import {AuthHttp, AuthConfig} from 'angular2-jwt';

And finally I have registered it in my providers array:

        provide(AuthHttp, {
            useFactory: (http) => {
                return new AuthHttp(new AuthConfig(), http);
            },
            deps: [Http]
        })
        AuthHttp,

What have I done wrong?

@chenkie
Copy link
Contributor

chenkie commented Feb 15, 2016

A couple other people were seeing this error. Take a look at this issue and let me know if anything there helps at all :)

@patrickreck
Copy link
Author

Thank you for the quick response. I was missing it in the System.config object. This fixed it:

"angular2-jwt": {
    "defaultExtension": "js"
}

@chenkie
Copy link
Contributor

chenkie commented Feb 15, 2016

Nice! No prob.

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

No branches or pull requests

2 participants