-
Notifications
You must be signed in to change notification settings - Fork 788
Description
It seems that @react-three/drei/native's useGLTF is currently broken on Expo SDK 53 and React 19 due to an outdated usage of BlobManager. Although this has been patched in the latest commit of @react-three/fiber/native, it's not yet published. Combined with the way @react-three/drei/native imports textures, this results in a runtime error and prevents GLTF models from loading correctly.
I confirmed this behavior using the example from https://github.com/CodyJasonBennett/r3f-rn-simple/tree/master with the following package versions:
"dependencies": { "@expo/metro-runtime": "~5.0.4", "@react-three/drei": "^10.5.1", "@react-three/fiber": "^9.2.0", "expo": "^53", "expo-gl": "~15.1.7", "expo-status-bar": "~2.2.3", "react": "19.0.0", "react-dom": "19.0.0", "react-native": "0.79.5", "react-native-web": "~0.20.0", "three": "^0.167.1" }, "devDependencies": { "@babel/core": "^7.26.0" }Additionally, I manually patched the following files under
node_modules/@react-three/fiber/native/dist/by updating the BlobManager import as follows (applied to all builds just in case):
react-three-fiber-native.cjs.dev.jsreact-three-fiber-native.cjs.prod.jsreact-three-fiber-native.esm.jsconst BlobManagerModule = require('react-native/Libraries/Blob/BlobManager.js'); const BlobManager = BlobManagerModule.default ?? BlobManagerModule;Also, I noticed that if the import:
import { useGLTF } from '@react-three/drei/native'is changed to:
import { useGLTF } from '@react-three/drei'(i.e., removing
"native"), everything works correctly with Expo Go, Expo SDK 53, and React 19!In summary:
- If the latest commit on
@react-three/fiber/nativeis published, and- If the bug in
@react-three/drei/nativeis fixed,then the following issues will be resolved:
- Texture loading failures
- a.k.a
url.lastIndexOf is not a functionerror- a.k.a
Error: Creating blobs from 'ArrayBuffer' and 'ArrayBufferView' are not supportederrorThank you very much. Best regards.