nocode-js / sequential-workflow-designer

Customizable no-code component for building flow-based programming applications or workflow automation. 0 external dependencies.
https://nocode-js.com/
MIT License
1.08k stars 111 forks source link

nextjs deployment - window is not defined #147

Closed brampurnot closed 5 months ago

brampurnot commented 5 months ago

Hi guys,

love this package. I have an issue though when deploying it to Vercel:

orchestrate:build: ReferenceError: window is not defined

21:59:34.871 | orchestrate:build: at file:///vercel/path0/node_modules/sequential-workflow-designer-react/lib/esm/index.js:53:1 21:59:34.871 | orchestrate:build: at ModuleJob.run (node:internal/modules/esm/module_job:195:25) 21:59:34.871 | orchestrate:build: at async ModuleLoader.import (node:internal/modules/esm/loader:336:24) 21:59:34.872 | orchestrate:build: at async importModuleDynamicallyWrapper (node:internal/vm/module:429:15) 21:59:34.880 | orchestrate:build:

Any chance you could check if the window is not undefined? I was able to workaround it now by wrapping it in another component and then dynamically loading it but would be great if this could be solved in the future. If not, then we can just keep this as a reference for others.

Bram

b4rtaz commented 5 months ago

Hello @brampurnot,

yes, currently we recommend to import the designer with disabling the server side rendering. I added a new section here that describes it.

brampurnot commented 5 months ago

Awesome thanks!