Debug a blocked fetch or XHR
When the console reads "has been blocked by CORS policy", paste the failing URL and your site's origin here to see whether the server sends Access-Control-Allow-Origin at all, and whether it matches. The verdict tells you the fix belongs on the server, not in your JavaScript.