Kiho / react-form-builder

A complete react form builder that interfaces with a json endpoint to load and save generated forms. The toolbox contains 16 items for gathering data. Everything from star ratings to signature boxes!
MIT License
465 stars 345 forks source link

Nextjs: window is not defined #311

Open richardpickett opened 1 month ago

richardpickett commented 1 month ago

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,
});
Saurav017 commented 2 weeks ago

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