Importing addons without npm

I’m working in an environment without npm. Importing THREE works as expected with the latest tag:

import * as THREE from ''

But importing OrbitControls is another story. this works:

import { OrbitControls } from ''

But this does not:

import { OrbitControls } from ''

It raises the following error:

Uncaught TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../".

Does anyone know why that is?

The OrbitControls.js module contains dependencies on “three”. You’ll have to tell the browser how to resolve that import (and any others). See “Install from CDN or static hosting”, under the Installation guide. This requires adding an Import Map as shown in the guide.

1 Like

I’ve now included three and all the add-ons in the project using the importmap and it works. Thanks!

1 Like