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

Axios 1.2.3 breaks clients generated by orval #740

Closed
soulchild opened this issue Jan 23, 2023 · 2 comments
Closed

Axios 1.2.3 breaks clients generated by orval #740

soulchild opened this issue Jan 23, 2023 · 2 comments

Comments

@soulchild
Copy link

What are the steps to reproduce this issue?

  1. Upgrade axios from 1.2.2 to 1.2.3

What happens?

Axios 1.2.3 introduced changes to its types which break clients generated by Orval:

error TS2345: Argument of type '{ headers?: AxiosRequestHeaders | undefined; url?: string | undefined; method?: string | undefined; baseURL?: string | undefined; transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[] | undefined; ... 31 more ...; formSerializer?: FormSerializerOptions | undefined; }' is not assignable to parameter of type 'AxiosRequestConfig<any>'.
Types of property 'headers' are incompatible.
  Type 'AxiosRequestHeaders | undefined' is not assignable to type 'AxiosRequestHeaders'.
    Type 'undefined' is not assignable to type 'AxiosRequestHeaders'.
      Type 'undefined' is not assignable to type 'Partial<RawAxiosHeaders & MethodsHeaders & CommonHeaders>'.

What were you expecting to happen?

Axios patch-level upgrades shouldn't break existing code. ;-)

openapi-generator, zodios and a couple of other libraries are broken as well. There's an ongoing discussion over at axios/axios#5420

@soulchild soulchild changed the title Axios 1.2.3 breaks Orval-generated clients Axios 1.2.3 breaks clients generated by orval Jan 23, 2023
@soulchild
Copy link
Author

Seems like there is already a PR underway which is supposed to fix this: axios/axios#5486

@melloware
Copy link
Collaborator

This is already fixed in Axios and can be closed.

@melloware melloware closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2023
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