sureshchahal / angular2-adal

Angular 2 wrapper for adal.js
MIT License
41 stars 50 forks source link

Observable.thow is not a function #40

Closed isaacrlevin closed 7 years ago

isaacrlevin commented 7 years ago

I get this error in the handle error handler

Error: Uncaught (in promise): TypeError: a.Observable.throw is not a function TypeError: a.Observable.throw is not a function at AuthHttp.sendRequest ()

According to this issue in rxjs, there is a context issue that can easily be resolved

https://github.com/ReactiveX/rxjs/issues/1866

Here you just need an include for import 'rxjs/add/observable/throw';

And this bug goes away. I can create a PR or you can just add it if you like.

sureshchahal commented 7 years ago

thanks @isaac2004. Can you please create a PR?

isaacrlevin commented 7 years ago

@sureshchahal Done! https://github.com/sureshchahal/angular2-adal/pull/41

abdel-ships-it commented 7 years ago

I have a strange feeling import 'rxjs/add/observable/throw' won't solve the problem as my typescript compiler still cannot find throw even if its imported.

Just a heads up but I think yourthrow.d.ts under rxjs/add/observable/ is empty.

sureshchahal commented 7 years ago

This issue is fixed as i have reverted change to import just Observable. Still looking for ways to reduce size

rjwijnen commented 7 years ago

Please reopen this issue. With 1.0.1 i got this error again: ERROR TypeError: Observable_1.Observable.throw is not a function at AuthHttp.webpackJsonp../node_modules/ng2-adal/services/authHttp.service.js.AuthHttp.sendRequest

isaacrlevin commented 7 years ago

@rjwijnen are you using the latest version?

rjwijnen commented 7 years ago

Yes, i am using the latest version. Can someone put the import 'rxjs/add/observable/throw'; back in the authHttp.service?

isaacrlevin commented 7 years ago

@realappie @sureshchahal did we test that my PR wasn't needed? I still think it is per issues addressed

sureshchahal commented 7 years ago

I don't get any observable error during build. I will check later today. On Fri, Jun 2, 2017 at 8:06 AM Isaac Levin notifications@github.com wrote:

@realappie https://github.com/realappie @sureshchahal https://github.com/sureshchahal did we test that my PR wasn't needed? I still think it is per issues addressed

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/sureshchahal/angular2-adal/issues/40#issuecomment-305781990, or mute the thread https://github.com/notifications/unsubscribe-auth/ARLaH3Ya1xkL2rJD8AY7qGGaxUw-qJpNks5sAAjugaJpZM4NNDNR .

isaacrlevin commented 7 years ago

@sureshchahal try to stub out calling an api that returns a 500. That is how I tested

rjwijnen commented 7 years ago

Have you test this again @sureshchahal ?