'Axios network error on firefox for subsequent requests (works on all other browsers)

I am using axios with mock service worker library to intercept api calls at network level. My code works on all browsers and even firefox incognito but not on normal firefox browser. I narrowed it down to the issue being with axios as when I use standard fetch api everything works on normal firefox.

The first time the page loads and the call is made eveything works fine, but then when I reload the page I get this error

Api call is made in useEffect when app.tsx loads.

GEThttp://localhost:3000/v1/login
[HTTP/1.1 404 Not Found 2ms]

Uncaught (in promise) Error: Request failed with status code 404
    createError createError.js:16
    settle settle.js:17
    onloadend xhr.js:66
    dispatchXhrRequest xhr.js:80
    xhrAdapter xhr.js:15
    dispatchRequest dispatchRequest.js:58
    request Axios.js:112
    method Axios.js:136
    wrap bind.js:9
    fetchWebsites App.tsx:20
    App App.tsx:24
    React 5
    unstable_runWithPriority scheduler.development.js:468
    React 3
    workLoop scheduler.development.js:417
    flushWork scheduler.development.js:390
    performWorkUntilDeadline scheduler.development.js:157
    js scheduler.development.js:180
    js scheduler.development.js:645
    Webpack 21
createError.js:16



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source