I am making a get request in "create react app" as shown below through an AWS lambda function url, but I am getting the error shown in picture below. When I do the same exact request in postman or in web browser I don't get any error. I am allowing cors in my lambda function. Does anyone know the cause of the error?
THE CODE:
function searchStock() { fetchStock().then(resp=> { console.log(resp) }).catch(err=> console.log(err)) } async function fetchStock() { let res = await axios.get("AWS lambda function url"); return res; }