Closed alinafatima closed 1 year ago
import anime from "animejs/lib/anime.es.js";
-> import anime from "animejs"
animejs/lib/anime.es.js
was identified as commonjs
. So you should use import anime from "animejs"
.
It's resolved now!!Thanks @Yukiniro!
Replaceimport anime from "animejs/lib/anime.es.js"
with import anime from "animejs"
,
and the anime is code has to be put into useEffect
useEffect(() => {
anime({
loop: true,
targets: "#gear1 path",
rotate: 360,
easing: "linear",
});
}, []);
Describe the bug I get the following bug when I reload my page from the Next App:
To Reproduce Steps to reproduce the behavior:
npx create-next-app@latest --typescript
npm install animejs --save
npm i --save-dev @types/animejs
Add the following code:
The code runs fine when I add and save the code. The error occurs when I reload the page.
Expected behavior There should be no error.
Screenshots
Desktop (please complete the following information):
Next version:
"next": "13.2.4",
Anime.js