michalsnik / aos

Animate on scroll library
MIT License
26.14k stars 2.54k forks source link

AOS is not working with NexJs in production #696

Open gkp-dev opened 2 years ago

gkp-dev commented 2 years ago

I try AOS on my website made with NextJs and it worked nicely in development but in production the layout doesn't appear.

`import { useEffect } from 'react' import AOS from 'aos' import 'aos/dist/aos.css'

function Header() { useEffect(() => { AOS.init({ duration: 1600 }) })

return (

) }

export default Header`

bob-nem commented 2 years ago

On my NexJs project it not work too

gkp-dev commented 2 years ago

I thought at first it was the server side rendering made by nextJs but It's not and and i don't know why.

meik1998dev commented 2 years ago

same issue

digeverything commented 2 years ago

Looks like you might be experiencing the same issue as #574 which has a suggested solution https://github.com/michalsnik/aos/issues/574#issuecomment-904994056