Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface 'CookieAgent<BaseAgent>' incorrectly extends interface 'BaseAgent' #37

Closed
BeataKr opened this issue Nov 29, 2021 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@BeataKr
Copy link

BeataKr commented Nov 29, 2021

I'm facing with ts problem

node_modules/http-cookie-agent/index.d.ts:14:11 - error TS2430: Interface 'CookieAgent<BaseAgent>' incorrectly extends interface 'BaseAgent'.
  'CookieAgent<BaseAgent>' is assignable to the constraint of type 'BaseAgent', but 'BaseAgent' could be instantiated with a different subtype of constraint 'any'.

14 interface CookieAgent<BaseAgent extends http.Agent> extends BaseAgent {

My configuration is kind of simple:

import axios from 'axios';
import { HttpCookieAgent } from 'http-cookie-agent';
import { CookieJar } from 'tough-cookie';

const jar = new CookieJar();
this.axios.defaults.httpAgent = new HttpCookieAgent({
        jar,
        keepAlive: true,
      });

Used version of packs:

"dependencies": {
    "axios": "^0.24.0",   
    "http-cookie-agent": "^1.0.3",   
    "tough-cookie": "^4.0.0",
    },
"devDependencies": {
    "@types/tough-cookie": "^4.0.1",   
    "typescript": "4.4.4"
  }

Any idea how to resolve problem?

@BeataKr BeataKr added the bug Something isn't working label Nov 29, 2021
@BeataKr
Copy link
Author

BeataKr commented Nov 29, 2021

This is not a bug, but a kind of future feature that can be done. An error can be disabled by

{
  "compilerOptions": {
    "skipLibCheck": true,
    ...
}

3846masa added a commit that referenced this issue Dec 25, 2021
3846masa added a commit that referenced this issue Dec 25, 2021
@3846masa
Copy link
Owner

Thanks for reporting.

It has been fixed in v1.0.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants