vendredi 29 janvier 2021

Importing useGLTF from '@react-three/drei/useGLTF' cause Module not found:

I have installed the react three fiber here's a dependences

"dependencies": {
"@react-three/drei": "^3.0.0",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.3",
"@testing-library/user-event": "^12.6.0",
"drei": "^2.2.21",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.1",
"react-spring": "^8.0.27",
"react-three-fiber": "^5.3.18",
"three": "^0.125.1",
"web-vitals": "^0.2.4"

},

and I run npm i drei

after it, I tried to import useGLTF

import { useGLTF } from '@react-three/drei/useGLTF'

and I got error

./src/Components/Three/Scene.js
Module not found: Can't resolve '@react-three/drei/useGLTF' in 'D:\coding\react\mincraft\src\Components\Three'

I decided to check the file manually inside @react-three/drei/useGLTF but there's no name such as useGLTF

do I need to run something else ?




Aucun commentaire:

Enregistrer un commentaire