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

Index signature missing for OAuth.Header (typescript) #99

Open
mskd12 opened this issue Aug 6, 2020 · 1 comment
Open

Index signature missing for OAuth.Header (typescript) #99

mskd12 opened this issue Aug 6, 2020 · 1 comment

Comments

@mskd12
Copy link

mskd12 commented Aug 6, 2020

Hi,

I am using the output of toHeader in the fetch API and I see the following error:

error TS2322: Type 'Header' is not assignable to type 'Record<string, string> | Headers | string[][] | undefined'.
      Type 'Header' is not assignable to type 'Record<string, string>'.
        Index signature is missing in type 'Header'.

    136             headers: this.client.toHeader(body)

Any thoughts on how to fix it?

@ejose19
Copy link

ejose19 commented Jun 28, 2021

This seems to be an odd behavior with Typescript, Data, Header & Authorization interfaces need to be declared as a type instead of an interface. For now you can use headers: this.client.toHeader(body) as Record<string, string> while it's solved at library level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants