ever-co / ever-demand

Ever® Demand™ - Open Commerce Platform - https://everdemand.co
https://everdemand.co
GNU Affero General Public License v3.0
1.69k stars 456 forks source link

[Bug] Cross-Origin Request Blocked #1529

Open SnowyTheVampire opened 1 year ago

SnowyTheVampire commented 1 year ago

Bug Report

Hi, this is more personalized to a fork of ever-demand than the origin, so I apologize in advance. I did reach out on discord for the best tangible means of asking for assistance. I've tried to replicate ever-demand mostly for educational purposes, with the hope to find a tangible ecommerce solution at the same time.

The first issue I experienced was with MongoDB localhost, that I solved by changing the http:// links from localhost to 127.0.0.1, due to it wanting to handshake on ipv6 (::1) instead of ipv4...

But the second issue which I am currently stuck on is an error thrown in browser, during yarn run:server and run:shopweb, stating: "Cross-Origin Request Blocked: The Same Origin policy disallows reading the remote resource at http;//****. (Reason: CORS header 'Access-Control-Allow-Origin' missing). Status code: 200."

🔎 Search Terms

Cross-Origin Request Blocked Socket.io + Node.js Cross-Origin Request Blocked How to fix this CORS issue in socket.io?

🕗 Version & Regression Information

🙁 Actual behavior

After fresh installing Node + everything that's bundle with it (npm, python, Microsoft tools, etc), globally re-installing yarn latest, installing MongoDB, running 'yarn install' within the relevant origin folder to download dependencies, running 'yarn build:all' and launching the servers with 'yarn run:server' and 'yarn run:shopweb', I am greeted with working environments. (I had better luck with 'yarn install', than trying to use 'yarn bootstrap', 'yarn lerna bootstrap' or npm installing lerna globally).

However, when i connect to localhost:4200, which both 'yarn run:shopweb' and 'yarn run:admin' are wanting to load onto (shopweb not running on 3000 for some reason?), I am greeted with the Cross-Origin Request Blocked error. This is a repeating error that is preventing then sending and receiving of information.

Screenshot: firefox_eiAAD6J6ed

Edit: Random paragraph duplication made it illegible

djriffle commented 1 year ago

I'm experiencing the same issue, has there been any progress on this?

evereq commented 1 year ago

@SnowyTheVampire @djriffle are you running all in http, without https? And all runs on 127.0.0.1? From screenshot, it's not clear what URL you try to open in browser, only clear that it tries to connect to socket.io server running on port 5500 on 127.0.0.1... So it means that issues are to connect from admin / web shop to socket.io host?