question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When using Axios client the TypeScript generated types are incorrect with latest version of axios@0.27.2

See original GitHub issue

Here is an example of the error message from the generated request.ts core file.

TS2322: Type 'AxiosResponse<unknown, any>' is not assignable to type 'AxiosResponse<T, any>'.
  Type 'unknown' is not assignable to type 'T'.
    'T' could be instantiated with an arbitrary type which could be unrelated to 'unknown'.
        return axiosError.response;

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
jtc42commented, Aug 25, 2022

If you found a solution write it down here for the next passer-by! Don’t make my mistake. 😄

Truth be told we just switched to OpenAPI Generator. It’s definitely clunkier than this repo but for our specific requirements it was a neater fit anyway.

1reaction
jtc42commented, Aug 24, 2022

Ah ok, thanks for the tip!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript imports not working · Issue #5082 · axios ... - GitHub
It doesn't work since v1.0.0 (0.27.2 works fine with the same codebase), importing axios results in an undefined variable. Any idea what to...
Read more >
Type Error In axios/index.d.ts After Updating From TS 4.6.4 to ...
As the title says, I updated a few dependencies tonight, and now I get an error when I use the npx tsc command....
Read more >
axios/CHANGELOG.md - UNPKG
This badge will show the version on CDNJS! 463, - Documentation update to clear up ambiguity in code examples ([#2928](https://github ...
Read more >
How to use Axios with Vue.js - LogRocket Blog
The promise-based HTTP client Axios can be used with Vue, a simple frontend JavaScript framework, to create web applications.
Read more >
cannot read properties of undefined (reading 'post') axios
Note: If you wanted to really use Axios via this.axios , you should add it to the Vue prototype, ... I installed version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found