It seems that the OPTIONS request is being sent before the fetch request, which is causing the CORS error.
It's important to note that this issue only occurs in production mode and not in the development environment. The error message I receive is shown in the attached screenshot.
I have registered an interceptor in my app.js file in react as follows:
However, when I use SWR to fetch data, I encounter a CORS error. Here's the code I'm using for the fetch:
It seems that the OPTIONS request is being sent before the fetch request, which is causing the CORS error. It's important to note that this issue only occurs in production mode and not in the development environment. The error message I receive is shown in the attached screenshot.