Attempted import error: 'OrbitControls' is not exported from 'three' (imported as 'THREE')

You need to make 2 import statements, and then treat them separately. Everything that’s part of the core Three.js library will be under THREE.XXX and the orbit controls will be standalone, not inside of THREE

import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";

// ...

var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera();
var controls = new OrbitControls();

Notice that OrbitControls does not need THREE. in front of it, because you imported it independently.

1 Like