Error on loading models

Hi, folks
I was getting a wired error when using the scene loader loading model on mobile. I was using the same method SceneLoader.importMesh to load the model and everything is fine on the desktop. But on mobile, I got the error

BJS - [12:43:50]: Unable to import meshes from somepath/mesh.gltf: Cannot read property 'forceBitmapOverHTMLImageElement' of undefined

searched on google seems no luck on any issue about this. The only thing we found that might be related is in here Babylon.js/thinEngine.ts at master · BabylonJS/Babylon.js · GitHub. Any idea what causes this issue? Thanks in advance!!

Can you share a repro somewhere?

not really for now, I can try to create one later, another info might help we are trying to add the model into a WebXR(using the immersive AR setting) scene not sure if it has some impact

Just want to make sure not the model problem tried with https://models.babylonjs.com/aerobatic_plane.glb, it works fine on PG but reports the same error in our repo.
This is the code I tried
SceneLoader.ImportMesh('', 'https://models.babylonjs.com/', 'aerobatic_plane.glb', scene, async (meshes) => {})

The error I got:
BJS - [15:04:26]: Unable to import meshes from https://models.babylonjs.com/aerobatic_plane.glb: Cannot read property 'forceBitmapOverHTMLImageElement' of undefined

another one to add, it randomly loads the model correctly but only like 2 out of 10,

False alarm, sorry. This was being caused by a smaller Babylon scene not being wired correctly yet for mobile and erroring out like below ( it was not finding its canvas )

Though I don’t get how this was not affecting our main scene before going to AR. Could be some kind of bug there but alls well that ends well.

1 Like