Skip to content

ReferenceError: window is not defined #97

Description

@IvonaPilcevic

When I try to use coverflow it just says "ReferenceError: window is not defined" and it doesn't work.

I am using react with nextjs.
For now, I found a hotfix using `let Carousel = null;

try {
if (global.window) {
Carousel = require("react-coverflow");
}
} catch (error) {
console.log("!coverflow-error ", error);
}`

but it's still showing me a warning Warning: Expected server HTML to contain a matching <div> in <div>. .
Is there any better solution?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions