I follow the documentation of React Three Fiber but get stuck in this issue.
And dependencies
Finally, I found out the reason for this issue.
I'm using the version 8 of @react-three/fiber
and Vitejs
, so I have to extend
manually
import { extend} from '@react-three/fiber'
import { Mesh, BoxGeometry, MeshStandardMaterial } from 'three'
extend({ Mesh, BoxGeometry, MeshStandardMaterial })
refer this: https://docs.pmnd.rs/react-three-fiber/api/canvas#tree-shaking