voliva / angular2-interceptors

79 stars 20 forks source link

Build failed using System JS #12

Closed johnidm closed 7 years ago

johnidm commented 7 years ago

Hi

When I run the command npm run build this error occurred Uncaught TypeError: Cannot read property 'InterceptedRequest' of undefined.

But, when I use npm serve this error doesn't occur.

I created a repositry on GitHub to reproduce the error https://github.com/johnidm/ng2-interceptor-problem

I am using System JS to load ǹg2-interceptor: https://github.com/johnidm/ng2-interceptor-problem/blob/master/src/systemjs.conf.js

I am following this set up InterceptorService https://github.com/johnidm/ng2-interceptor-problem/blob/master/src/app/app.module.ts#L29

voliva commented 7 years ago

Can you try with v1.2.1 I published now? Haven't tried, but it seems like SystemJS doesn't like interfaces in javascript (mainly because they don't exist), I have removed the references in index.js file.

johnidm commented 7 years ago

@voliva thanks for attention, this works fine with v1.2.1

voliva commented 7 years ago

Thank you too :) I will push the changes done this evening to github.