I’m just getting into the world of Three.js. I’ve tried using “Orbit controls” but an error keeps popping up in the console. The error I’m talking about is: index.html:1 “Uncaught TypeError: Failed to resolve module specifier ‘three’. Relative references must start with either ‘/’, ‘./’, or ‘../’.” I swear I’ve tried everything, I’ve placed the files in my local folder, tried accessing them through relative paths. I usually use “live server” from VSC as my server, but because of this error I even tried using “web-dev-server” and a server through Node.js, and still, nothing worked. I’m out of ideas at this point. I’ve asked several AIs for help, but nothing has worked. I’ll try to explain how my folder with the files is structured.
This is the folder structure that contains all the code. I’ve now tried switching from “orbit controls” to “fly controls” to see if that would work, but that didn’t work either.
This is the structure of the HTML.
This is the structure of the “main” JS file
And then there are both files, “three.module.” and “flycontrols.js”, which I downloaded from the official GitHub from these links: unpkg.com/three@0.161.0/build/three.module.js and unpkg.com/three@0.161.0/examples/jsm/controls/FlyControls.js
As I mentioned, I’ve now switched from “orbit controls” to “fly controls” to see if the issue was with “orbit controls”, but no, the same error keeps appearing. I really hope you can help me, thank you.