# Unexpected Magic? Glb/react babylonjs

**URL:** <https://forum.babylonjs.com/t/unexpected-magic-glb-react-babylonjs/28110>\
**Category:** Questions\
**Created:** [March 3, 2022, 6:50am UTC](https://forum.babylonjs.com/t/unexpected-magic-glb-react-babylonjs/28110 "2022-03-03T06:50:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajanrahman](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rajanrahman/32/22618_2.png) [@rajanrahman](https://forum.babylonjs.com/u/rajanrahman)\
**Post date:** [March 3, 2022, 6:50am UTC](https://forum.babylonjs.com/t/unexpected-magic-glb-react-babylonjs/28110/1 "2022-03-03T06:50:29Z")

</div>

Getting this error message:

react-reconciler.production.min.js:128 Error: Unexpected magic: 1936876918  
at glTFFileLoader.ts:841:23

strangely, my glb file works locally. I use Netlify to serve my site, but then I get the error above. Any solutions?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [March 3, 2022, 3:08pm UTC](https://forum.babylonjs.com/t/unexpected-magic-glb-react-babylonjs/28110/2 "2022-03-03T15:08:16Z")

</div>

Hello and welcome to the Babylon community!

The “unexpected magic” error refers to the GLB format header, which has to have a specific value: [glTF™ 2.0 Specification (khronos.org)](https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#binary-header) - 0x46546C67 in hex which is 1179937895 in decimal. Since your file is working fine locally but not remotely, I wonder if this might be some kind of server setup adding data to the beginning of your files? 🤔

How are you loading this GLB? Do you have it in a directory in your setup and load it from that path?

---

<div class="post-metadata">

**Author:** ![brianzinn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brianzinn/32/28013_2.png) [@brianzinn](https://forum.babylonjs.com/u/brianzinn)\
**Post date:** [March 3, 2022, 4:44pm UTC](https://forum.babylonjs.com/t/unexpected-magic-glb-react-babylonjs/28110/3 "2022-03-03T16:44:14Z")

</div>

Put your model assets in the `/public` folder. If you a model in `/public/models/myModel.glb`, for example, then the rootUrl of your models is `/models`.

What’s happening is that babylonjs is being served your index.html file for every file that cannot be found - this is how we can navigate to `/some/random/url` and the react-router will pick up on that. You can look in your network tab to confirm this is happening, but also when you get the folder/rootUrl right you will see that.

edit: upon re-reading it may be a configuration issue. Are you deploying to the root folder or your netlify site? If you are in a sub-folder then you need to edit the “homepage” in your package.json to set the rootUrl correctly.  
edit 2: and then use `${process.env.PUBLIC_URL}/models`

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 1, 2022, 12:09pm UTC](https://forum.babylonjs.com/t/unexpected-magic-glb-react-babylonjs/28110/4 "2022-04-01T12:09:10Z")

</div>

Hello @rajanrahman just checking in if you still have an issue

---

<div class="post-metadata">

**Author:** ![JaChadwell](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jachadwell/32/26436_2.png) [@JaChadwell](https://forum.babylonjs.com/u/JaChadwell)\
**Post date:** [September 16, 2022, 1:29am UTC](https://forum.babylonjs.com/t/unexpected-magic-glb-react-babylonjs/28110/5 "2022-09-16T01:29:59Z")

</div>

This answer helped me fix the same problem after hours of trying to figure it out. Thank you!
