Cuberto / mouse-follower

A powerful javascript library to create amazing and smooth effects for the mouse cursor on your website.
MIT License
724 stars 60 forks source link

Text/Image/Video mode - cannot set properties of undefined (setting 'innerHTML') #19

Open mroddev opened 1 year ago

mroddev commented 1 year ago

Hi.

Getting a Uncaught TypeError: Cannot set properties of undefined (setting 'innerHTML') when using either of the Text, Image or Video mode.

I'm using it with Nuxt 3 and everything else seems to work fine.

This is how I'm setting it up.

CustomCursor.vue component:

<template>
  <div class="cursor mf-cursor -exclusion"
       ref="cursorRef"></div>
</template>

<script setup>
import MouseFollower from "mouse-follower";
import gsap from 'gsap';

MouseFollower.registerGSAP(gsap);

const cursorRef = ref()

onMounted(() => {
  const cursor = new MouseFollower({
    el: cursorRef.value,
    speed: 0.8,
    skewing: 3,
  });
})
</script>

Then the component above is loaded inside app.vue file. I know you can't see the SCSS import, but they are being loaded on an internal file.