How to fix cors origin issue in SFPx.
Are you trying to fetch external data but keeps on getting cors origin issue?
How to fix cors origin issue in Spfx? It's really disgusting facing this issue. Here let's take a look at the simple way to solve the issue. Steps: npm i axios import the axios in your code import axios from "axios" ; Reconstruct a fetch url by appending a custom url before the main fetch url Eg. await axios . get ( "https://api.rss2json.com/v1/api.json?rss_url=" + fetchURL) . then (( res ) => { console.log(res) }) The above method will convert any xml to json and will fix the cors origin issue. #Related Questions How to fix CORS Orgin issue in spfx...
Canonical URL: https://khangkhuiphungdhar.vercel.app/read/how-to-fix-cors-origin-issue-in-sfpx