I want to animate SVGs using Kute.js, which was installed using npm, in NextJS.
I have created an animations.js file inside a js folder in the public directory ‘public/js/animations.js’. Then I tried adding it to my component which holds the svgs but it kept returning the following error ‘KUTE is not defined’.
My public/js/animations.js code
const animate = KUTE.fromTo('firstSVG', {path: '#firstSVG' }, { path: '#secondSVG' });
animate.start();
Using Script from ‘next/script’ to import the js file
<Script src="/js/animations.js"/>