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

Extended Axios.AxiosRequestConfig from #408 breaks interceptor types #441

Closed
mgdodge opened this issue Nov 13, 2020 · 0 comments · Fixed by #476
Closed

Extended Axios.AxiosRequestConfig from #408 breaks interceptor types #441

mgdodge opened this issue Nov 13, 2020 · 0 comments · Fixed by #476

Comments

@mgdodge
Copy link

mgdodge commented Nov 13, 2020

Using 5.12.1, things work fine. Installing 5.12.2 (which introduces the change from #408) breaks things pretty badly.

For example, I use something like

$axios.onRequest((config: AxiosRequestConfig) => {
  // Do stuff
  return config;
})

because request interceptors should always return the config.

5.12.1 doesn't complain at all. But 5.12.2 refuses to build. The error is:

Error:(72, 19) TS2345: Argument of type '(config: AxiosRequestConfig) => AxiosRequestConfig' is not assignable to parameter of type '(config: AxiosRequestConfig) => void'. Types of parameters 'config' and 'config' are incompatible.

@mgdodge mgdodge changed the title Incorrect type for onRequest Extended Axios.AxiosRequestConfig from #408 breaks interceptor types Nov 13, 2020
@pi0 pi0 closed this as completed in #476 Feb 8, 2021
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

Successfully merging a pull request may close this issue.

1 participant