Skip to content
MNAth_ edited this page Jan 18, 2022 · 2 revisions

CORS Issues

You may encounter CORS-related errors in your browser console during development. Something like :

Access to XMLHttpRequest at 'http://localhost:5500/socket.io/?...' from origin 'http://localhost:4201' 
has been blocked by CORS policy: No 'Access- Control-Allow-Origin' header is present on the requested resource.

To solve the problem, we recommend using the Allow CORS: Access-Control-Allow-Origin extension (on google chrome), which allows you to easily add " Access-Control-Allow-Origin: *" rule to the response header. This solution is the simplest and fastest for the moment.

Otherwise, we have a track that consists in setting the localhost protocol from HTTP to HTTPS directly in the script of the package.js file. Which gives something like:

"script-name": "... && HTTPS=true && ...". or "script-name": "... && set HTTPS=true && ...".

Feel free to bring us your contribution on this point if you have any, we will greatly appreciate your help 😀.