Closed jrock17 closed 2 years ago
Hello! Thanks for reporting this issue.
Draggabilly was designed for the browser. See https://github.com/desandro/draggabilly/pull/101#issuecomment-140589998
I feel like the conditional should be higher up — this module shouldn't be loaded in the first place
That said, I'm open to improving support for server-side rendering, so these errors don't get in the way of your development. Could you help me understand what you're looking for?
I'm not sure what the fix is. But the error I get is: packery.js:481 })( window ); ^ ReferenceError: window is not defined
I've tried some node/react ports but they don't seem to work. Would be great if it was compatible.
@jrock17 you can add the following in your entry point:
if (typeof window === 'undefined') {
global.window = global
}
This is more of a hack and it should work for your situation.
Draggabilly v3 has been released that checks for window
and falls back to this
.
Is there a way to use this (and packery) in a React/NodeJS environment?
When I try to require, I get a bunch of errors around 'window is not defined'.
Thanks!