elementz icon indicating copy to clipboard operation
elementz copied to clipboard

`ReferenceError: window is not defined` in Next.JS

Open TheBotlyNoob opened this issue 4 years ago • 3 comments

Trying to use this in Next.JS throws ReferenceError: window is not defined.

Really like the look of this UI, so I hope this gets fixed soon.

Thanks in advance!

TheBotlyNoob avatar Jul 10 '21 03:07 TheBotlyNoob

Try installing the latest version (2.0.5) I have added some checks before using the window object

If there is still an issue then you should follow this guide: https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr

el1s7 avatar Jul 13 '21 12:07 el1s7

Getting: ReferenceError: document is not defined, I will use the dynamic import until you push a fix.

TheBotlyNoob avatar Jul 13 '21 20:07 TheBotlyNoob

The issue seems to be from dependencies So possibly https://github.com/maslianok/react-select-me and it's dependency -> https://github.com/bvaughn/react-virtualized

Try tracking down what is causing it and let me know

el1s7 avatar Jul 14 '21 13:07 el1s7