THREE.STLLoader is not a constructor

Viewed 2391

I have been trying to load a STL model on three.js I keep getting THREE.STLLoader is not a constructor on the console

this is my code:

  var loader = new THREE.STLLoader();
   loader.load( '3dbenchy-1.stl', function ( geometry ) {
   scene.add( new THREE.Mesh( geometry ) );
   });
2 Answers

within a builded three.js there is an examples folder, inside this folder there is two folders "js" and "jsm", use jsm for ES6 modules. Do not combine js class against modules

Related