Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shows Window is not Defined #48

Open
Kingshuk3006 opened this issue Aug 12, 2022 · 1 comment
Open

Shows Window is not Defined #48

Kingshuk3006 opened this issue Aug 12, 2022 · 1 comment

Comments

@Kingshuk3006
Copy link

image
Though i have writen similar code as demo image..its keeps showing me window is not defined.

@sparshsharma2510
Copy link

@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, } );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants