react-form-builder icon indicating copy to clipboard operation
react-form-builder copied to clipboard

Nextjs: window is not defined

Open richardpickett opened this issue 1 year ago • 1 comments

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

richardpickett avatar Aug 08 '24 03:08 richardpickett

Hello @richardpickett , if the issue is still there, can you please assign it to me ??

Saurav017 avatar Aug 30 '24 03:08 Saurav017