Error Loading GLTF: Invalid typed array length: 84 at new Uint16Array

In my code I have tried to make it possible to access the information on my gltf, it was first an IFC file and then using blender I exported it as a gltf file but now I am getting this error

image

Here is my code:

const loadGLTFModel = () => {
      const loader = new GLTFLoader();


      loader.load(
        'model-.gltf',
        (gltf) => {
            const model = gltf.scene;
            scene.addd(model);
        },
        undefined,
        (error) => {
          console.error('Error loading model:', error);
        },
      );
    };

In addition, the same code and file seems to work on my colleague’s computer and IDE but not mine and are methods/steps to load the model were identical yet I only seem to be getting this error.

I was wondering if anyone has run into this issue before and if so could you please enlighten me on how to solve it?

Your loading code looks correct.

Try dragging your gltf on https://gltf-viewer.donmccurdy.com/

Or here:

If it shows up in those, then we can investigate further…

Thank you! I figured out the error was that I did not include the .bin file after converting the ifc file

2 Likes

Ahh yeah… The binary flavor of GLTF (.glb) is nice for this, since it packages everything in one file! Materials+Textures+Meshes!

2 Likes