react icon indicating copy to clipboard operation
react copied to clipboard

With Next.js Got error: document is not defined

Open vivekvt opened this issue 5 years ago • 5 comments

I am getting error for FormBuilder Component. I saw old issue from octomber 2019 which is closed https://github.com/formio/react-formio/issues/253 which told react-formio@4 will have SSR Support. I am got same error in [email protected] document is not defined

ReferenceError: document is not defined
    at Object.<anonymous> (/home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:869:23)
    at Object.8 (/home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:895:4)
    at s (/home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:1:621)
    at /home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:1:672
    at Object.<anonymous> (/home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:724:19)
    at Object.6../eventmap (/home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:824:4)
    at s (/home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:1:621)
    at /home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:1:672
    at Object.<anonymous> (/home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:41:17)
    at Object.2../classes (/home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:647:4)
    at s (/home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:1:621)
    at e (/home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:1:792)
    at /home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:1:810
    at /home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:1:88
    at Object.<anonymous> (/home/vivekvt/Desktop/codemarket.io/unita/files/node_modules/dragula/dist/dragula.js:1:323)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)

Screenshot from 2020-09-23 20-53-46

  • Hosting type
    • Local deployment
  • Frontend framework: Next.js 9.3.2 [email protected]
  • Browser: Google Chrome
  • Browser version: 84.0.4147.125

vivekvt avatar Sep 23 '20 15:09 vivekvt

I am closing the issue as it was created too long ago and there is no new comments here. If the issue is not resolved, please reopen it. Thanks!

TanyaGashtold avatar Aug 31 '23 13:08 TanyaGashtold

This is still not resolved. Can we reopen this? I am using Next and getting this error constantly:

Next: 15.1.5 React: 18.3.1

umarq91 avatar Jan 31 '25 19:01 umarq91

Are you using @formio/[email protected]?

lane-formio avatar Feb 04 '25 15:02 lane-formio

Yes its 6.0.0

umarq91 avatar Feb 06 '25 17:02 umarq91

@umarq91 did you see https://github.com/formio/react?tab=readme-ov-file#usage-in-nextjs ?

brendanbond avatar Feb 12 '25 21:02 brendanbond