hammerjs / hammer.js

A javascript library for multi-touch gestures :// You can touch this
http://hammerjs.github.io
MIT License
24.09k stars 2.63k forks source link

Make hammerjs server friendly #1060

Open elmerbulthuis opened 7 years ago

elmerbulthuis commented 7 years ago

When redering views on a server (like in a universal / isomorphic application) we do not have a window or document instance. This will result in an error in hammer.js.

Ofcourse hammer.js has no use in a server environment, but hammer.js should not throw an error when it's only being included (via require, or import).

This here, line 2643 in the hammer.js file:

})(window, document, 'Hammer');

is causing trouble, window and document are not defined in a server environment.

udivankin commented 7 years ago

Posted a workaround in #930

squadette commented 5 years ago

This is fixed in @squadette/hammerjs@2.1.0-pre3: https://github.com/squadette/hammer.js/issues/2

ghbakhtiari commented 3 years ago

any news on this?

dave-vdg commented 2 years ago

Any updates on this?