Closed maxnbf closed 2 years ago
I am not familiar with react, but I found this when searching for your error: https://stackoverflow.com/questions/41497674/access-control-allow-origin-issue-when-api-call-made-from-react-isomorphic-ap. One of the comments links to this question: https://stackoverflow.com/questions/51701630/typeerror-networkerror-when-attempting-to-fetch-resource. Since I don't know much about react I don't fully understand the solution, but hopefully those will help you. If not, I would suggest asking for help in a react-specific forum.
Closing since this is a react issue and not related to this package
Im trying to make an axios request on the client side of a react web app and im receiving this error.
Access to XMLHttpRequest at 'https://statsapi.mlb.com/api/v1/schedule?sportId=1&teamId=110&opponentId=108&season=2019' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Was curious if youve ever come across this when working with the MLB api. Most of the solutions ive found online i dont really understand so just asking here since you seem to be an expert with this API. If this is out of your depth, I understand. Thanks!