-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error loading OBJ model in React Native #3199
Comments
This is rather unlikely to be related to r3f; given that the error is coming from It seems you are requiring assets directly, which won't resolve to actual loadable resources. See the Expo-Asset section on loading assets, and this section in particular: // Create an Asset from a resource
const asset = Asset.fromModule(require('./image.png'));
await asset.downloadAsync();
// This is the local URI
const uri = asset.localUri; |
See #3085 (comment). We polyfill some web APIs since react-native either doesn't implement them or implements them wrongly. There I have a workaround and pending fix. glTF and other formats parse correctly OOTB, we're still working to have everything consistent without hassle. |
Problem:
When attempting to load an OBJ model in my React Native application using React Three Fiber and Three.js, I encounter an error "text.split is not a function" that appears to be related to the model loading.
Environment:
"dependencies": {
"@react-three/fiber": "^8.15.16",
"expo": "~50.0.8",
"expo-asset": "^9.0.2",
"expo-file-system": "^16.0.7",
"expo-gl": "^13.6.0",
"expo-status-bar": "~1.11.1",
"expo-three": "^7.0.0",
"react": "18.2.0",
"react-native": "0.73.4",
"three": "^0.162.0"
}
The text was updated successfully, but these errors were encountered: