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

Type issue with Typescript and Axios #53

Open
mcfearsome opened this issue Apr 16, 2021 · 2 comments
Open

Type issue with Typescript and Axios #53

mcfearsome opened this issue Apr 16, 2021 · 2 comments

Comments

@mcfearsome
Copy link

Hello, I am trying to use this in a lambda and I am using typescript. When I try to set request in the config to axios as described in the readme, I get the following compilation error.

Type 'AxiosStatic' is not assignable to type '(fetchContext: FetchContext) => Promise<Response>'.
  Types of parameters 'config' and 'fetchContext' are incompatible.
    Type 'FetchContext' is not assignable to type 'AxiosRequestConfig'.
      Types of property 'method' are incompatible.
        Type 'string' is not assignable to type 'Method'.ts(2322)
@jgsqware
Copy link

I got the same

@jgsqware
Copy link

this works for me const axios = require('axios').default;

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