You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
mgdodge
changed the title
Incorrect type for onRequest
Extended Axios.AxiosRequestConfig from #408 breaks interceptor types
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
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.
The text was updated successfully, but these errors were encountered: