After switching from using the CDN link for threejs in my html to importing threejs through npm and using webpack to compile everything, I encountered an issue. Despite no error messages during compilation, my webapp breaks with an error stating that THREE is not defined. Below are the import statements I am currently using:
import * as THREE from 'three';
import OrbitControls from 'three/examples/js/controls/OrbitControls.js'
import OBJLoader from 'three/examples/js/loaders/OBJLoader.js'
Upon inspecting the browser console, the error points me to the source code of OrbitControls, and when I commented out its import statement, the error then directed me to the source code of OBJLoader. None of my own code is causing these issues, but I can provide it if needed for debugging purposes. When removing both of those import statements and leaving only import * as THREE from 'three';
, the page loads without errors, although the 3d model I'm trying to render does not appear. Any assistance would be greatly appreciated.