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 instance (using alias) typing: headers is required althought all the headers are optional #298

Closed
vltansky opened this issue Jan 22, 2023 · 5 comments

Comments

@vltansky
Copy link

Argument of type '{ params: { rReferenceId: number; }; queries: { queryparams: { loanAmountTo: number; } | {}; }; }' is not assignable to parameter of type 'DeepReadonlyObject<{ headers: { "X-Session-ID"?: string; "X-Aid"?: string; "X-Channel-ID"?: string; "X-Message-ID"?: string; "X-Transaction-ID"?: string; "X-Uid"?: string;  } & Partial<...> & AxiosHeaders; ... 32 more ...; formSerializer?: FormSeria...'.
  Property 'headers' is missing in type '{ params: { rReferenceId: number; }; queries: { queryparams: { loanAmountTo: number; } | {}; }; }' but required in type 'DeepReadonlyObject<{ headers: { "X-Session-ID"?: string; "X-Aid"?: string; "X-Channel-ID"?: string; "X-Message-ID"?: string; "X-Transaction-ID"?: string; "X-Uid"?: string;  } & Partial<...> & AxiosHeaders; ... 32 more ...; formSerializer?: FormSeria...'.ts(2345)
zodios.types.d.ts(130, 5): 'headers' is declared here.
@ecyrbe
Copy link
Owner

ecyrbe commented Jan 22, 2023

Yes this is a breaking change from axios.
Not zodios fault. revert to axios 1.2.2. cf : axios/axios#5420 to wait for axios to fix this.

@ecyrbe ecyrbe closed this as completed Jan 22, 2023
@ecyrbe ecyrbe reopened this Jan 22, 2023
@ecyrbe
Copy link
Owner

ecyrbe commented Jan 22, 2023

Please confirm reverting fix your issue.

@ecyrbe
Copy link
Owner

ecyrbe commented Jan 22, 2023

For v11 i find a way to be compatible for this change. so i'll backport this change to v10

@ecyrbe
Copy link
Owner

ecyrbe commented Jan 22, 2023

@vltansky this is fixed in @zodios/core 10.7.2

@ecyrbe ecyrbe closed this as completed Jan 22, 2023
@vltansky
Copy link
Author

It's working. Thank you!

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