panva / openid-client

OAuth 2 / OpenID Connect Client API for JavaScript Runtimes
MIT License
1.83k stars 392 forks source link

Typescript compilation fails: does not satisfy the constraint #424

Closed S0c5 closed 2 years ago

S0c5 commented 2 years ago

Describe the bug Wrong types for HttpOptions, in this case the lookup option should be removed to make it work, but the latest package doesnt compile

node_modules/openid-client/types/index.d.ts:15:5 - error TS2344: Type '"timeout" | "key" | "passphrase" | "lookup" | "headers" | "ca" | "cert" | "crl" | "pfx" | "agent"' does not satisfy the constraint '"rejectUnauthorized" | "servername" | keyof RequestOptions | keyof SecureContextOptions'.
  Type '"lookup"' is not assignable to type '"rejectUnauthorized" | "servername" | keyof RequestOptions | keyof SecureContextOptions'.

To Reproduce

Steps to reproduce the behaviour:

  1. try to compile the project with the latest typescript version 4.4.4

Expected behaviour

That the library compiles

Environment:

Additional context Add any other context about the problem here.

panva commented 2 years ago

The inclusion of lookup is very much intended. You just have to update your @types/node package.