'Axios not working in React app: axios 404 error. createAxiosError (utils.js:151:1) at settle
I've had this issue with Axios. I am unsure what is the cause of it.
axios 404 error. createAxiosError (utils.js:151:1) at settle
It happens when I make any kind of call to axios. Here is one example of it
axios.get("https://api.publicapis.org/entries").then((response) => {
console.log(response);
}, (error) => {
console.log(error);
})
Any thoughts on what may be going wrong? I get the same error when running openapi generated typescript code.
thank you,
Solution 1:[1]
Anyone else having this problem, I would recommend examining the rest of the codebase. Specifically anything that is responsible for setting up axios. I deleted the part of the codebase that was "setting up" axios and a mockup of it, and that somehow resolved the issue. I had to cut out a few parts that used this mock of axios but those parts are not necessary for my webapp.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | newhire001 |
