Skip to content

Nextjs: window is not defined #311

@richardpickett

Description

@richardpickett

Issue #183 has resurfaced.

I tried to looking at the diff for v0.11.1 to see if I could figure out the fix. It didn't jump out at me.

For now I'm having to do this to work around:

// Question Editor:
import dynamic from "next/dynamic";
const ReactFormBuilder = dynamic(() => import("react-form-builder2").then((module) => module.ReactFormBuilder), {
  ssr: false,
});

// Question Display
import dynamic from "next/dynamic";

const ReactFormGenerator = dynamic(() => import("react-form-builder2").then((module) => module.ReactFormGenerator), {
  ssr: false,
});

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