# I am getting an error when switching from 7.22.5 to 7.49

**URL:** <https://forum.babylonjs.com/t/i-am-getting-an-error-when-switching-from-7-22-5-to-7-49/56580>\
**Category:** Questions\
**Tags:** mesh\
**Created:** [February 14, 2025, 1:16pm UTC](https://forum.babylonjs.com/t/i-am-getting-an-error-when-switching-from-7-22-5-to-7-49/56580 "2025-02-14T13:16:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Knifepro](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/knifepro/32/39429_2.png) [@Knifepro](https://forum.babylonjs.com/u/Knifepro)\
**Post date:** [February 14, 2025, 1:16pm UTC](https://forum.babylonjs.com/t/i-am-getting-an-error-when-switching-from-7-22-5-to-7-49/56580/1 "2025-02-14T13:16:10Z")

</div>

BABYLON.SceneLoader.ImportMesh which I used in version 7.22.5 and then the onMeshLoaded method I ran gives an error in version 7.49

```auto
var hallLoader = BABYLON.SceneLoader.ImportMesh(
			"",
			env.STATICS_SERVER + "/assets/babylon5/hall_yeni/",
			"hall.gltf",
			this.sahne,
			(meshes) => {
				var scale = 100;
				meshes[0].scaling = new BABYLON.Vector3(scale, scale, -1 * scale);
  }
		);
hallLoader.onMeshLoaded = (mesh) => {
console.log(mesh)
}

```

The error message I encountered  
↓↓↓↓  
Uncaught (in promise) TypeError: Cannot set properties of undefined (setting ‘onMeshLoaded’)

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [February 14, 2025, 2:15pm UTC](https://forum.babylonjs.com/t/i-am-getting-an-error-when-switching-from-7-22-5-to-7-49/56580/2 "2025-02-14T14:15:48Z")

</div>

Is this local? on the playground?

If it is local, did you update the loaders package as well?

---

<div class="post-metadata">

**Author:** ![Knifepro](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/knifepro/32/39429_2.png) [@Knifepro](https://forum.babylonjs.com/u/Knifepro)\
**Post date:** [February 14, 2025, 3:07pm UTC](https://forum.babylonjs.com/t/i-am-getting-an-error-when-switching-from-7-22-5-to-7-49/56580/3 "2025-02-14T15:07:45Z")

</div>

No No, local of course.  
I use CDN  
These packages  
[https://cdn.jsdelivr.net/npm/babylonjs-gui@7.49/babylon.gui.min.js](https://cdn.jsdelivr.net/npm/babylonjs-gui@7.49/babylon.gui.min.js)  
[https://cdn.jsdelivr.net/npm/babylonjs@7.49/babylon.js](https://cdn.jsdelivr.net/npm/babylonjs@7.49/babylon.js)  
[https://cdn.jsdelivr.net/npm/babylonjs-loaders@7.49/babylonjs.loaders.min.js](https://cdn.jsdelivr.net/npm/babylonjs-loaders@7.49/babylonjs.loaders.min.js)

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [February 14, 2025, 6:13pm UTC](https://forum.babylonjs.com/t/i-am-getting-an-error-when-switching-from-7-22-5-to-7-49/56580/4 "2025-02-14T18:13:36Z")

</div>

CC @ryantrem , ImportMesh returns void now. was the signature different before?

---

<div class="post-metadata">

**Author:** ![ryantrem](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ryantrem/32/34010_2.png) [@ryantrem](https://forum.babylonjs.com/u/ryantrem)\
**Post date:** [February 14, 2025, 8:15pm UTC](https://forum.babylonjs.com/t/i-am-getting-an-error-when-switching-from-7-22-5-to-7-49/56580/5 "2025-02-14T20:15:50Z")

</div>

Yes, when mime type support was added, it introduced new asynchrony in previously synchronous paths, and a breaking change was made to this API: [Adding support to mimetype autodetection by deltakosh · Pull Request #15798 · BabylonJS/Babylon.js](https://github.com/BabylonJS/Babylon.js/pull/15798/files#diff-361d36aa4cdaac48339ea6d2b5cc5c9e0525b0854f758be87e2c1697ea55319cR1569)

---

<div class="post-metadata">

**Author:** ![ryantrem](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ryantrem/32/34010_2.png) [@ryantrem](https://forum.babylonjs.com/u/ryantrem)\
**Post date:** [February 14, 2025, 8:24pm UTC](https://forum.babylonjs.com/t/i-am-getting-an-error-when-switching-from-7-22-5-to-7-49/56580/6 "2025-02-14T20:24:09Z")

</div>

You can do a similar thing with newer APIs though like this:

```ts
const assetContainer = await BABYLON.LoadAssetContainerAsync("https://raw.githubusercontent.com/BabylonJS/Assets/master/meshes/ufo.glb", scene, {
    pluginOptions: {
        gltf: {
            onMeshLoaded: (mesh) => {
                console.log(`Loaded mesh: ${mesh.name}`);
            },
        },
    },
});
assetContainer.meshes.forEach((mesh) => scene.addMesh(mesh));

```

Here is a PG for this: [Babylon.js Playground](https://playground.babylonjs.com/#A82J94#1)

---

<div class="post-metadata">

**Author:** ![Knifepro](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/knifepro/32/39429_2.png) [@Knifepro](https://forum.babylonjs.com/u/Knifepro)\
**Post date:** [February 18, 2025, 11:57am UTC](https://forum.babylonjs.com/t/i-am-getting-an-error-when-switching-from-7-22-5-to-7-49/56580/7 "2025-02-18T11:57:23Z")

</div>

Thank you very much \<3
