Open Kingshuk3006 opened 2 years ago
@Kingshuk3006 I think you are using some framework like NextJS which renders on the server side first. And because of this it throws such type of error because window is not defined on server side.
what you can do is Create a separate component file where you export this carousel component.
and then in the main Hero file use this
import dynamic from 'next/dynamic; const Carousel = dynamic( () => import("./path_to_the_carousel_file/Carousel"), { ssr: false, } );
Though i have writen similar code as demo image..its keeps showing me window is not defined.