angular-ssr icon indicating copy to clipboard operation
angular-ssr copied to clipboard

Hammer.js is not loaded

Open vlodkow opened this issue 7 years ago • 6 comments

When try to use Hummer.js on demand-express example get error from NodeJS: Error: Hammer.js is not loaded, can not bind swipeleft event

vlodkow avatar Jun 28 '17 12:06 vlodkow

Got the same thing today.

ERROR Error: Hammer.js is not loaded, can not bind swipeleft event at HammerGesturesPlugin.supports (...node_modules@angular\platform-browser\bundles\platform-browser.umd.js:3208:19) at EventManager.findPluginFor (...packages\platform-browser\src\dom\events\event_manager.ts:80:1) at EventManager.addEventListener (...node_modules@angular\platform-browser\bundles\platform-browser.umd.js:2430:44) at EmulatedEncapsulationDomRenderer2.DefaultDomRenderer2.listen (...node_modules@angular\platform-browser\bundles\platform-browser.umd.js:2952:36) at BaseAnimationRenderer.module.exports.BaseAnimationRenderer.listen (...dist-server\index.js:36400:30) at listenToElementOutputs (...node_modules@angular\core\bundles\core.umd.js:9232:66) at createViewNodes (...node_modules@angular\core\bundles\core.umd.js:12191:17) at callViewAction (...node_modules@angular\core\bundles\core.umd.js:12665:13) at execComponentViewsAction (...node_modules@angular\core\bundles\core.umd.js:12574:13) at createViewNodes (...node_modules@angular\core\bundles\core.umd.js:12246:5) at Object.createEmbeddedView (...node_modules@angular\core\bundles\core.umd.js:12102:5) at TemplateRef.createEmbeddedView (...node_modules@angular\core\bundles\core.umd.js:10298:38) at ViewContainerRef_.createEmbeddedView (...node_modules@angular\core\bundles\core.umd.js:10075:52) at NgIf._updateView (...packages\common\src\directives\ng_if.ts:159:1) at NgIf.set [as ngIf] (...node_modules@angular\common\bundles\common.umd.js:1933:18) at updateProp (...packages\core\src\view\provider.ts:569:1)

ktersius avatar Sep 05 '17 11:09 ktersius

Hmmm, strange. I am unable to reproduce. demand-express most certainly imports hammerjs. In main.ts:

import 'hammerjs';

Did you make any local changes?

clbond avatar Sep 19 '17 00:09 clbond

@clbond I did a little digging since we were running into some similar issues. I wasn't able to reproduce in the demand-express example but I was able to reproduce in the cli example as well as another barebones cli project with angular-ssr. Just attach a swipe event to an element and it'll throw this error

JinSY avatar Sep 21 '17 13:09 JinSY

Did you import hammerjs? There's no reason it shouldn't work

clbond avatar Oct 21 '17 00:10 clbond

Make sure you are using import 'hammerjs';
and not using import { hammerjs } from "path to hammer js";

mrinaljain avatar Jun 14 '19 19:06 mrinaljain

Make sure you are using import 'hammerjs'; and not using import { hammerjs } from "path to hammer js";

Unless you use custom baseUrl and path. Then you will have to use import '../node_modules/hammerjs';

dxm99 avatar Aug 01 '20 17:08 dxm99