I am querying an external API with Redux Toolkit
. I know that the external API allows requests from other rescoures. However, when I try to load the data, I get the following message:
{ status: “FETCH_ERROR”, error: “TypeError: NetworkError when attempting to fetch resource.” }
But, when I check the Network-Tab in my dev-tools for the request that returns this error to Redux Toolkit
, I see the response. The data is send. There is a small notification above it
Why does the browser see the response, but my Frontend (or better, Redux Toolkit), tells me that there is an error? This is my API Slice
with the relevant parts (I guess)
export const apiSlice = createApi({
reducerPath: 'api',
baseQuery: fetchBaseQuery({
baseUrl: API,
mode: "cors",
}),
endpoints: builder => ({ ... })
1