Skip to content

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

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

Closed
hc-advokate opened this issue Sep 12, 2024 · 1 comment

Comments

@hc-advokate
Copy link

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

The axios version type is AxiosStatic, not AxiosInstance

@besotti
Copy link

besotti commented Oct 19, 2024

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.

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