Model loading issue

I am trying to add Babylon react native package in my react native project.
I’m getting error when I’m trying to load gltf, glb model.
I shared error screenshot.

I used following NPM’s:

@babylonjs/core”: “^5.10.0”,
@babylonjs/loaders”: “^5.10.0”,
@babylonjs/react-native”: “^1.2.0”,
@babylonjs/react-native-iosandroid-0-65”: “^1.2.0”,
“react”: “17.0.2”,
“react-native”: “0.65.0”,
“react-native-permissions”: “^3.0.0”,

I tried with BaybylonJS latest NPM versions also still getting same issue.

My latest NPM versions

@babylonjs/core”: “^5.26.1”,
@babylonjs/loaders”: “^5.26.1”,
@babylonjs/react-native”: “^1.3.5”,
@babylonjs/react-native-iosandroid-0-65”: “^1.3.5”,
“react”: “17.0.2”,
“react-native”: “0.65.0”,
“react-native-permissions”: “^3.6.1”

I don’t know why this error is keep coming.

cc @ryantrem

It looks to me like the recent change Add type on blob creation (#12912) · BabylonJS/Babylon.js@209855c ( introduced the call to getResponseHeader, and this function is not implemented in Babylon Native’s XmlHttpRequest native polyfill.

@Chandru1214 can you try:

@babylonjs/core”: “^5.21.0”,
@babylonjs/loaders”: “^5.21.0”,

That is the newest version that does not include the change that introduced the call to getResponseHeader.

@bghgary - thoughts on this? Do we want to change BJS to not call getResponseHeader in for this scenario (not sure if there is another option), or do we want to implement getResponseHeader in the Babylon Native XmlHttpRequest native polyfill?

I noticed this issue last Friday after fixing the console issue which is also something that broke Babylon Native from the JS side. I think we can just implement this method on XMLHttpRequest. It shouldn’t be too hard. In the meantime, we should use the older versions.

I have tried with below npm version, it’s working fine.
@babylonjs/core”: “5.21.0”,
@babylonjs/loaders”: “5.21.0”,
Thanks you.

1 Like

maybe we can also think of a way to define proper typings for both web and native to know what’s available where and avoid those issues in the future? Or is it an issue that doesn’t pop up too often?