Hammer.js: Make hammerjs server friendly

Created on 3 Jan 2017  路  3Comments  路  Source: hammerjs/hammer.js

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.

Most helpful comment

any news on this?

All 3 comments

Posted a workaround in #930

any news on this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Loginstudio picture Loginstudio  路  3Comments

priyankaviswan picture priyankaviswan  路  5Comments

f3rixi picture f3rixi  路  6Comments

PatreekH picture PatreekH  路  5Comments

mandawino picture mandawino  路  11Comments