TypeError: Cannot read properties of undefined (reading 'rotation')

Hello there, I’m trying to clone this effect Gooey Hover Effects on Images with Three.js | Codrops
with nextjs
but i got this error always

TypeError: Cannot read properties of undefined (reading ‘rotation’)

this is my code

any suggestion ?

I think it is better to initialize the threejs in useEffect