Unsupported glTF-Binary header: Expected "%s" to be "%s"

Hi, I’m new to Three.js, and I tried to import a glb 3D model, but I got this error:
Unsupported glTF-Binary header: Expected “%s” to be “%s”.

This is the model I used. I made it on Blender 2.8 and exported it to .glb.
Hugo.glb (15.4 KB)
I searched for a similar issue, but I didn’t find anything :frowning_face:

The model works fine here:

https://gltf-viewer.donmccurdy.com

So there is a problem with your code somewhere.

If you want further help, please share all of your code here. Ideally as a live example using codesandbox.io or glitch.com

Thank you for your answer. Here’s the code : https://codesandbox.io/embed/game-l5ufr?fontsize=14

So do you have any ideas ? I copied the example in the doc, and it still doesn’t work, so it does not seem to be related to the code :confused:

Hmm, not sure what’s going on there. It might be a Webpack issue, not importing the model correctly.

I can’t help you with webpack though. Also, my cursor in codesandbox is a couple of characters out of place, so its very hard for me to make edits to you files. Not sure what’s going on there.

You have the three.js package twice, and you don’t need three-gltf-loader:

  "dependencies": {
    "lodash": "^4.17.15",
    "three": "^0.84.0",
    "three-gltf-loader": "^1.109.0"
  },
  "devDependencies": {
    "three.js": "^0.77.1",
    "webpack": "^4.41.2",
    "webpack-cli": "^3.3.9"
  }

Change this to:

  "dependencies": {
    "lodash": "^4.17.15",
    "three": "^0.109.0",
  },
  "devDependencies": {
    "webpack": "^4.41.2",
    "webpack-cli": "^3.3.9"
  }
1 Like

It works, thanks !
However I don’t have any textures, but I suspect it is a problem with my model, I will look into that.

I have been encountering this issue as well, but I’m not using a package.json.
I’m using Blender 3.0.0 (vsc live server to open it) and export it with the GLB format.
Screen Shot 2021-12-21 at 8.29.38 PM
I get the same error oddly

This kind of error usually has something to do with your local development server or how it’s set up. I’d suggest starting a new thread and sharing details about how your project is set up and someone will be able to help.

Okay, thanks for the advice.