Error importing FBX

An error:
TypeError: Cannot read property ‘add’ of undefined
at index.html:30
at Object.onLoad (FBXLoader.js:44)
at XMLHttpRequest. (three.js:26570)

How to solve it?

Do you mind sharing the FBX asset in this topic?

Maybe try this? That way you’ll be able to see if the model is loading at all. This is a TS version, might need to do some simple changes here and there.

// FBX model loading
const fbxLoader: FBXLoader = new THREE.FBXLoader();
  (object) => {
    // do some stuff to the object before adding it to the scene, e.g. set scale.
    // object.scale.set(0.02, 0.02, 0.02);

  (xhr) => {
    console.log((xhr.loaded / * 100 + '% FBX loaded');
  (error) => {

Uncaught SyntaxError: Missing initializer in const declaration

In your case you might need to use the fbxLoader initialisation like above. If your error is what I’m thinking. What you code looks like now?

Uploading: 卫星…
Upload failure is too big

Follow the code you sent

remove the
: FBXLoader
That part with the red squigly under it including the colon in front of it.

That is a typescript annotation and not supported in javascript.

Also, you appear to be using the commonjs version of threejs.
Try declaring the fbxloader using something like
const fbxLoader = new THREE.FBXLoader()

I think your 1st version of code was ok. The problem is likely with your model

I just noticed that you haven’t instantiated a scene, camera or renderer in your 1st version of the code.

1 Like

Consider to share the model with a service like Google Drive.