#Error when fetching data with astro/react

2 messages · Page 1 of 1 (latest)

autumn falconBOT
#

Hi @still hill. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Hmm, I don't know enough to give you a confident answer yet. The information extracts provided do not contain specific details about handling CORS errors when using fetch with SWR in a React component within Astro.

However, CORS errors typically occur when a web application tries to access resources from a different domain, and the server doesn't allow cross-origin requests. This is a security feature implemented in all modern web browsers.

In your case, it seems like the server at 'https://adm.level10.es' might not be set up to accept cross-origin requests from your Astro application's domain. You might need to configure the server to allow such requests.

For more information on how to use fetch in Astro, you can refer to the Astro Documentation (https://docs.astro.build).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: