akashuba / react-timeline-animation

react-timeline-animation component
39 stars 7 forks source link

IntersectionObserver is not defined #4

Closed helmuth99 closed 1 month ago

helmuth99 commented 2 months ago

Hello I am using your component in a Next.js project and i am getting the following error.

Internal error: ReferenceError: IntersectionObserver is not defined
    at TimelineObserver (./node_modules/react-timeline-animation/dist/index.js:130:37)
    ... Next.js runtime compiled stuff...
digest: "2391649287"

Everything seems to work normal, but I, ll just report this as a bug.

helmuth99 commented 2 months ago

Hello it seems to be a problem with SSR By adding the following line, thx to https://github.com/akashuba/react-timeline-animation/issues/1 fixed it

const TimelineObserver = dynamic( () => import("react-timeline-animation"), {ssr: false})