Coder Social home page Coder Social logo

Comments (10)

gund avatar gund commented on May 22, 2024 2

Today I made use of this library in different project and experienced same issue so was able to check by myself how to fix this.
And yes compilerOptions -> lib: ["es6"] is the key point here - it tells TS compiler to include es6 type definitions in the project.

However in my particular case there where some external libs which were not able to compile with this configuration so in this case I left config as is and added next line to my custom definitions file:

declare interface ProxyHandler<T> {}

That fixed issue as well.

from ng-http-interceptor.

gund avatar gund commented on May 22, 2024

That's totally fine since class ProxyHandler is part of standard library and it's location in file like that can tell you about it.

from ng-http-interceptor.

jorawarsingh avatar jorawarsingh commented on May 22, 2024

Yes but i am getting this as error and it interceptor is not working. i am getting this error as well in browser cannot find name proxyhandler. i am using webpack.

from ng-http-interceptor.

gund avatar gund commented on May 22, 2024

Well that's interesting. Are you using it in project generated via angular-cli?
Maybe you can share your tsconfig.json?

from ng-http-interceptor.

dondimon avatar dondimon commented on May 22, 2024

I'm getting same issue - using Angular 2.1.1... can't build either.. can't build with either tsc or visual studio TS compiler.

node_modules/ng2-http-interceptor/dist/http/interceptable-http-proxy.service.d.ts(3,63): error TS2304: Cannot find name 'ProxyHandler'.

from ng-http-interceptor.

gund avatar gund commented on May 22, 2024

Well as far as I can see it seems that your TS compiler does not support ES6 typings.
You can try to upgrade it to version 2.0.1.
Or if that does not help you can go and get this typing file, put it in your project and reference in your entry point *.ts file.

from ng-http-interceptor.

jorawarsingh avatar jorawarsingh commented on May 22, 2024

I'm targeting es5. I have tried to target es6 but it seems to be many issues with that so till they are resolved i have to stick to es5.
microsoft/TypeScript#3215
angular/angular#4882

from ng-http-interceptor.

gund avatar gund commented on May 22, 2024

@jorawarsingh so if you target ES5 this issue gone?

from ng-http-interceptor.

jorawarsingh avatar jorawarsingh commented on May 22, 2024

No, still remain.

from ng-http-interceptor.

gund avatar gund commented on May 22, 2024

Can you please try to compile with next options in tsconfig.json:
compilerOptions -> lib: ["es6", "dom"]
compilerOptions -> module: "es6"

I'm also targeting ES5 but don't have this issue so probably those settings might resolve them.

from ng-http-interceptor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.