Skip to content

ReferenceError: window is not defined in Next.js #50

@noam-elbaz

Description

@noam-elbaz

Any suggestion for how to best manage importing a Canvas component without causing errors from Next.js like this:
ReferenceError: window is not defined in Next.js.

Currently - I'm doing this:

const CanvasSketch = dynamic(() => import('../components/CanvasSketch'), {
  ssr: false,
})

but if you have better, more reliable solutions, would appreciate it.

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