Closed 6utt3rfly closed 7 years ago
Hi, thanks for reporting an issue.
First what comes into my mind is version mismatch, you should be using angular v2.3.0 or higher. Please try to update and run again.
And also can you tell which version you are trying to use (cause as far as I know Ionic using AOT and this library got AOT support only since v1.0.0)
Thanks
Unfortunately, Ionic requires specific angular versions, so I can't update to v2.3.0 or higher. Thank you for your quick response though!
Well maybe you can at least try to load lib without proxy polyfill (if a web view supports it natively of course) so we can have better understanding which part is failing?
I was able to switch to angular2-interceptors, but it is less versatile and more restrictive where my interceptors have to be careful not to use Http to avoid cyclic dependencies. I think I'll still need proxy polyfill in order to support a wider range of mobile devices. But I'll see if I can dig a bit deeper to see where it's failing...
Error is coming from:
__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
where 'object' is undefined and 'property' is HttpInterceptorService
Unfortunately this piece of code does not tell me anything since it is generated and I guess not by ngc but by ionic itself which I haven't tried yet.
Maybe I will try to create some simple Ionic app and import lib there to get better understanding what might happen there.
Hi @Emmpa.
I was able to test it in Ionic 2 and I found some weird code generation from Webpack which was trying to access import before it was actually resolved. So the first fix which crossed my mind is to rearrange exports and I did it - and it fixed the issue =)
I also verified some basic interceptions for requests/responses to make sure everything works well - and it is.
So will push a fix in a while, please do verify that it fixes the issue on your side as well and if not go ahead and reopen this one.
Thanks
Hi @gund ! Thank you for looking into this! It looks like your change has resolved my issue (and I had to do something minor when it complained about undefined "__extends"), but I can use your module now! Thank you!!
Good to know that it works =) Regarding your minor issue you can have a look at #89.
I'm just trying to import this into an ionic 2 rc-4 app. I npm installed this and proxy-polyfill. If I include HttpInterceptorService in either my class constructor (and don't even use it), or if I add it to @NgModule.imports, then I get a runtime error when the app starts: