voliva / angular2-interceptors

79 stars 20 forks source link

TypeError: Cannot read property 'interceptorOptions' of undefined #13

Closed barocsi closed 7 years ago

barocsi commented 7 years ago

Happens as

TypeError: Cannot read property 'interceptorOptions' of undefined
    at InterceptorService.request (x\node_modules\ng2-interceptors\lib\interceptor-service.js:94:44)
    at AuthHttp.requestWithToken (\x\node_modules\angular2-jwt\angular2-jwt.js:109:26)
    at MergeMapSubscriber.eval [as project] (x\node_modules\angular2-jwt\angular2-jwt.js:133:107)

angular2-jwt uses Http that is currently provided by ng2-interceptor. However seemingly it passes an undefined options argument that interceptor-service does not handle well.

barocsi commented 7 years ago

Bump

voliva commented 7 years ago

@barocsi Can you try if this is fixed on version 1.2.2 please? (Commit is available here: https://github.com/voliva/angular2-interceptors/commit/9ac7470396c9ad00472048d5980b174048df34f9)

barocsi commented 7 years ago

Works thanks.