Currently, I am attempting to run the examples from three.js
locally in a web browser on MacOS. To do this, I have cloned the entire three.js
repository and attempted to open a file in a browser (such as
three.js/examples/misc_controls_orbit.html
). However, upon doing so, I encountered error messages in the console:
Access to script at 'file:///Users/me/three.js/build/three.module.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
I tried searching for methods to successfully run these examples in a browser and stumbled upon some information HERE, but still faced difficulties. I navigated to the example
directory and initiated a Python server. Although accessing the server address in the browser displayed a list of examples, clicking them did not yield any results. The console displayed errors such as:
GET http://0.0.0.0:8000/files/main.css net::ERR_ABORTED 404 (File not found)
I am seeking guidance on what steps or configurations may be necessary to successfully run these examples locally in a browser. Any advice would be greatly appreciated.