Skip to content

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

@mgdodge

Description

@mgdodge

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions