You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
yizhilee
changed the title
ttriger cors when work with swr
triger cors when work with swr
Jul 26, 2023
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.
The text was updated successfully, but these errors were encountered: