0

I’m trying to create a timer in THREE.js. All the libraries are installed through NPM and the seem to be correctly installed, I’ve created a scene and loaded an object with a GLTFLoader. Orbit controls also all seem to be working correctly. Other modules are importing correctly eg:

import * as THREE from 'three';
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';

But when I enter: import { Timer } from 'three/addons/misc/Timer.js'; I get the error `Unable to resolve the path to module 'three/addons/misc/Timer.js'. I’ve tried looking in the node_moduls folder, in the three folder. But I can’t even find the addons folder. So I’m a bit confused. Can anyone tell me what I’m doing wrong?

3
  • 1
    Which version of Three.js are you using? Commented Jan 30 at 22:33
  • there's no folder three/addons/ it represents three/examples/jsm/ so you need to check three/examples/jsm/misc/Timer.js in module Commented Jan 31 at 6:42
  • Thank you so much, I’ll take a look later today. Got another project on deadline first though Commented Jan 31 at 10:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.