Unable to fetch results client-side
Closed this issue · 2 comments
thuonghd3 commented
Describe the bug
I am having problems on the client side.
Access to fetch at 'https://www.youtube.com/results?search_query=aaaaaa&page=0&sp=EgIQAQ%253D%253D' from origin 'http://localhost:3001' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
DrKain commented
This is because YouTube doesn't allow CORS requests. If you want to use this client side you will need to make the search back-end and serve the response to the client.
thuonghd3 commented
Ok. Thanks