IdentityModel / oidc-token-manager

Apache License 2.0
51 stars 36 forks source link

Not working with JSPM-Loader #7

Closed kuechlerm closed 8 years ago

kuechlerm commented 9 years ago

When using JSPM, I get this error:

Uncaught ReferenceError: DefaultHttpRequest is not defined

The error is caused by Line 17 in oidc-token-manager.js

var _httpRequest = new DefaultHttpRequest();

I checked the folder and found that oidc-token-manager@0.1.2.js is not pointing to dist/oidc-token-manager.js. I changed the path, now it seems to be working.

I am not an expert of JSPM... is this helpful?

brockallen commented 9 years ago

I'm not a JSPM expert either, but thanks for reporting this. I'll try to look into when I get a chance (or if you can fix it and send a PR we can do that too).

kuechlerm commented 9 years ago

I played a bit around and have a clearer picture now - or so I hope: JSPM seems to pick up the file that is specified in the "main" property in package.json, thus ./oidc-token-manager.js is used.

I can think of 3 solutions now:

  1. update ./oidc-token-manager.js from ./dist/oidc-token-manager.js (+ new version no. I guess)
  2. change the "main" property in package.json to the right file (+ new version no. I guess)
  3. when using JSPM to load the module one could require the path to the file like so: IdentityModel/oidc-token-manager/dist/oidc-token-manager (no changes to the repo necessary)

For the moment, I go with option no. 3, but it's a hack.

brockallen commented 8 years ago

Was this working out? If not, feel free to send a PR with a better fix.