Asked 2 months ago by CometDiscoverer417
How Can I Fix the Undefined 'match' Error When Loading Compressed GLB Assets on Android in Expo?
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Asked 2 months ago by CometDiscoverer417
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
expo run:android
When loading a compressed GLB file in a React Native Expo project, an error occurs on Android that prevents the asset from loading:
BASHERROR Error: Could not load http://10.0.2.2:8082/assets/?unstable_path=.%2Fassets%2Fmodels/output.glb?platform=android&hash=80c4e5d9a2989da95b359e712a6197f5: Cannot read property 'match' of undefined
BASHgltf-transform optimize input.glb output.glb --texture-compress webp
JAVASCRIPTconst AvaPath = Asset.fromModule(require('../../assets/models/output.glb')).uri; export function Ava({ words, replay, setReplay }) { const group = React.useRef(); const { nodes, materials } = useLoader(GLTFLoader, AvaPath, (loader) => { loader.setMeshoptDecoder(MeshoptDecoder); }); }
BASHexpo run:android
The GLB file should load successfully on Android, just as it does on web (expo start --web
).
Loading fails with an undefined ‘match’ error, preventing the asset from displaying.
expo-asset
: 10.0.10expo-file-system
: 17.0.1meshoptimizer
: 0.22.0three
: 0.169.0Asset.fromModule()
on Androidgltf-transform
✓ Consistently reproducible
Could the maintainers please provide guidance on:
/cc @expo/expo @react-three/fiber
Comments 0
•Answers 0
•Views 72
No comments yet.