-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Module '"axios"' has no exported member 'AxiosError'.ts(2305) #6527
Comments
@BarishSarac, try removing the |
Hello @Anonymous961, I created a new nextjs app to test from scratch. So I used |
I had the same issue, this fixed it for me @BarishSarac try using a venv maybe? |
@Jey-Alt, thank you for recommendation It worked when I upgraded packages, deleted node_modules and installed it back |
{ updating tsconfig.json fixed the issue for me |
In my case it was that I installed @types/axios by error. The package is unmantained, so don't use it. Removing it from package.json and "npm i" did the trick |
@manuman94 or uninstall the package: npm uninstall @types/axios |
Describe the issue
Hi,
I have nextjs typescript app and I am using AxiosError like
onError?.(error as AxiosError);
and I getModule '"axios"' has no exported member 'AxiosError'.ts(2305)
error. I installed types doingnpm install axios @types/axios
still same issue, also they are importedimport axios, { AxiosError } from "axios";
. How can I fix this?Example Code
Expected behavior
AxiosError not to show error in typescript
Module '"axios"' has no exported member 'AxiosError'.ts(2305)
Axios Version
1.7.3
Adapter Version
No response
Browser
Chrome
Browser Version
127
Node.js Version
20.15.1
OS
No response
Additional Library Versions
No response
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered: