ctimmerm / axios-mock-adapter

Axios adapter that allows to easily mock requests
MIT License
3.47k stars 245 forks source link

Vue: Argument of type AxiosStatic is not assignable to parameter of type AxiosInstance #397

Closed hc-advokate closed 1 month ago

hc-advokate commented 2 months ago

"axios": "^1.7.7", "axios-mock-adapter": "^2.0.0",

The axios version type is AxiosStatic, not AxiosInstance

besotti commented 1 month ago

I don't think this is an issue with the package; you probably just have a different version of Axios installed (or maybe two different versions within your monorepo?).

This setup works:

import axios from 'axios';
import AxiosMockAdapter from 'axios-mock-adapter';

const axiosMock = new AxiosMockAdapter(axios);

Tested with axios@1.7.7 and axios-mock-adapter@2.1.0.