Skip to content

Error after upgrade to alpha 6: TypeScript cannot find HammerManager #797

Closed
@RoxKilly

Description

@RoxKilly

Been using alpha 5-2 along with Angular 2 rc.3 with no issues. Today I updated to ng2 rc4 as well as material2 alpha 6 and now typescript throws the following error during compilation:

/@angular2-material/core/gestures/MdGestureConfig.d.ts(4,40): error TS2304: Cannot find name 'HammerManager'.

After reading the discussion at #535, I added HammerJS to my typings.json

{
  "globalDependencies": {
    "core-js": "registry:dt/core-js#0.0.0+20160602141332",
    "hammerjs": "registry:dt/hammerjs#2.0.4+20160417130828",
    "jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
    "node": "registry:dt/node#6.0.0+20160621231320"
  }
}

That didn't fix the error (even if I set tsconfig's exclude to []. It's a bit disconcerting that a 3rd party library is throwing errors during compilation. Shouldn't you include all the d.ts files you rely on?

To quiet the error down, I added the following to my bootstrap main.ts

///<reference path="path/to/typings/globals/hammerjs/index.d.ts"/>

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions