ArcballControls.js throws error: "ambiguous indirect export: MathUtils"

I just wanted to use ArcballControls instead of OrbitControls (which works fine), but I am getting above error message for MathUtils. It’s related to the line in ArcvallControls.js where MathUtils is imported. (See below code snippet.) What can I do to fix this?
Thank you!

import {
} from "./three.module.js";

I’ve never seen this error message in context of three.js modules. How does your build setup look like?

Thanks for your quick reply!
Not sure if this is what you meant, but my script starts with:

import * as THREE from ‘/fk-test/3d-test4/js/three.module.js’;
//import {OrbitControls} from ‘/fk-test/3d-test4/js/OrbitControls.js’; // used before
import {ArcballControls } from ‘/fk-test/3d-test4/js/ArcballControls.js’;
import {GLTFLoader} from ‘/fk-test/3d-test4/js/GLTFLoader.js’;

So the error occurs right on top of the script after importing the basic “three” file.
All .js files are in the same folder on my web server.
Or do you mean there might be differences in the versions of the scripts?

Just in case the script versions could make a difference, I made sure I took the main module from here

and this arcball controls module:

Now I have a different error message :smiley:
Uncaught SyntaxError: ambiguous indirect export: ArcballControls

You can’t combine the ESM version of three.js with code from examples/js. Proper module files are located in examples/jsm.

It might be less error-prone to use a build tool instead of copy/past modules or library files into your project. A simple project setup with rollup looks like so: GitHub - Mugen87/three-jsm: Minimal three.js project setup using ES6 modules and rollup.

1 Like

I will try your setup recommendations. Thanks a lot! :slight_smile:

Is there any structured way of copying and setting up the necessary files and folders manually?
I tried above recommendations, but I neither have npm (command not found) nor node.js installed, no localhost server and I am working directly on a web server with somewhat limited permissions.
Alternatively I tried taking the module files from examples/jsm for controls and loaders, combined with three.js (and later three.module.js) from /dev/build/. None of the combinations worked for me.
Thank you!