Hi there I am trying to import Orbit controls from my node modules but it is giving the error provided in 2nd image.

Thank you
Hi there I am trying to import Orbit controls from my node modules but it is giving the error provided in 2nd image.
Thank you
This who I have my imports
import * as THREE from 'three';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
check if the OrbitControls file is in your node modules folder first. if not try
npm install three-orbitcontrols
you canโt import from node_modules, that folder does not exist in production or from the bundlers perspective. the whole point of it is that when you import something, say โthreeโ, it resolves it according to your local node_modules folder and then includes that bit in your bundle.
also you are missing the โ.jsโ extension on the import
I am pretty sure this is the right solution but for some reason simply importing after npm install <> does not seem to work. It might be probably because I did not set things up right from the start.
adding the .js extension worked. Thank you, everyone