Open branaust opened 5 months ago
three
@react-three/fiber
@react-three/drei
node
bun
Recieving url.lastIndexOf is not a function on initialization
url.lastIndexOf is not a function
/* Auto-generated by: https://github.com/pmndrs/gltfjsx */ import * as THREE from "three"; import React from "react"; import { useGLTF } from "@react-three/drei/native"; import { GLTF } from "three-stdlib"; import modelPath from "../assets/model.glb"; type GLTFResult = GLTF & { nodes: { Torus002: THREE.Mesh; }; materials: { Material: THREE.MeshStandardMaterial; }; }; const Model = (props: JSX.IntrinsicElements["group"]) => { const { nodes, materials } = useGLTF(modelPath) as GLTFResult; return ( <group {...props} dispose={null} scale={2}> <mesh castShadow receiveShadow geometry={nodes.Torus002.geometry} material={materials.Material} /> </group> ); }; useGLTF.preload(modelPath); export default Model;
import Model from "@/components/Model"; import { View } from "@/components/Themed"; import { Canvas } from "@react-three/fiber/native"; import { Suspense } from "react"; const Home = () => { return ( <View style={{ flex: 1 }}> <Canvas> <Suspense fallback={null}> <Model /> </Suspense> </Canvas> </View> ); }; export default Home;
Any updates on this issue?
Does the error occur if you do const { nodes, materials } = useGLTF('../assets/model.glb') as GLTFResult; ?
const { nodes, materials } = useGLTF('../assets/model.glb') as GLTFResult;
three
version: ^0.164.1@react-three/fiber
version: ^8.16.2@react-three/drei
version: 9.0.1node
version: 19.4.0bun
version: 1.0.22Problem description:
Recieving
url.lastIndexOf is not a function
on initializationRelevant code: