Addons aren't loading as in documentation

I updated threejs from 1.4.1 to 1.5.9 then, tried also to update imports according to documentation:

import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';

Then it says dependency is not found, while old imports are working:
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'

Also getting this warning:
[12:11:40 PM] WARN Scripts “build/three.js” and “build/three.min.js” are deprecated with r150+, and will be removed with r160. Please use ES Modules or alternatives

I’m using NPM

  1. Just to be super sure, you meant you updated from r141 to r159, right? Not whatever-npm-would-consider three@1.5.9 ?
  2. Can you show the code your using (HTML and JS, but only the part with the imports and the part where you’re using the GLTFLoader) ?
  1. Yes, from r141 to r159

At package JSON it appears as “three”: “^0.159.0”,

import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js
import * as THREE from ‘three’

const loader = new GLTFLoader()

// loading model
  (gltf) =>

'./../model/mymodel.glb' just a heads up, this is most likely not the issue, but if …/ is attempting to move outside the src folder this is an invalid path. given /public/model/mymodel.glb the correct path would be '/model/mymodel.glb'.

Model is loading as expected :slight_smile:

just mentioning it because after you fix your issue this will give you a 404 in production, it’ll be the next problem.

1 Like

thank you, will use absolute URL for this case :slight_smile: Meanwhile that works well