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

Compiled JS does not work with browserify #1

Closed
escardin opened this issue Nov 13, 2015 · 11 comments
Closed

Compiled JS does not work with browserify #1

escardin opened this issue Nov 13, 2015 · 11 comments

Comments

@escardin
Copy link
Contributor

Is it possible to have the compiled output be commonjs format instead of systemjs? I am having trouble using this library with browserify +tsify

@chenkie
Copy link
Contributor

chenkie commented Nov 16, 2015

Thanks for the feedback. I'd like to move it to commonjs eventually. Not sure if it will be the next release, but it will happen soon :)

@escardin
Copy link
Contributor Author

Okay. I ended up compiling it directly in my build in the meantime. It does give me warnings about implicit anys, but I can deal with that for now.

@bufke
Copy link

bufke commented Dec 2, 2015

@escardin could you explain your workaround in more detail?

@escardin
Copy link
Contributor Author

escardin commented Dec 2, 2015

I import the source instead of the package. i.e.:

import {AuthHttp,IAuthConfig,AuthConfig,tokenNotExpired} from '../../../../../node_modules/angular2-jwt/src/angular2-jwt.ts';

instead of

import {AuthHttp,IAuthConfig,AuthConfig,tokenNotExpired} from 'angular2-jwt';

@bufke
Copy link

bufke commented Dec 3, 2015

Strange I just get

./~/angular2-jwt/src/angular2-jwt.ts
Module parse failed: /code/node_modules/angular2-jwt/src/angular2-jwt.ts Line 1: Unexpected token
You may need an appropriate loader to handle this file type.
| import {Injectable, Injector} from 'angular2/angular2';

I'm using webpack but not sure why that would make any difference. Importing other typescript files works just fine.

@bufke
Copy link

bufke commented Dec 3, 2015

blah - copying it from node_modules elsewhere fixed it. Sorry this is a strange new world for me. Guessing webpack configuration issue..

@escardin
Copy link
Contributor Author

escardin commented Dec 3, 2015

I switched to webpack after filing this but still had the same problem, used the same workaround.

@chenkie
Copy link
Contributor

chenkie commented Dec 16, 2015

@escardin: can you check 0.1.3 with Webpack? The sample here has a Webpack setup.

@escardin
Copy link
Contributor Author

I switched from my fork to your version and it worked okay. :D

@chenkie
Copy link
Contributor

chenkie commented Dec 17, 2015

awesome thanks!

@chenkie chenkie closed this as completed Dec 17, 2015
@danikenan
Copy link

I have the same problem with latest version.
Installed with webpack. Ran on windows. Switched to my mac. git cloned the same project and could not get it to work from node_module. Had to copy the 'ts' file outside of node_modules and use it directly.

chenkie pushed a commit that referenced this issue Apr 16, 2016
chenkie pushed a commit that referenced this issue Sep 9, 2016
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

4 participants