Error after upgrade to alpha 6: TypeScript cannot find HammerManager
See original GitHub issueBeen 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"/>
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Error after upgrade to alpha 6: TypeScript cannot find ...
Error after upgrade to alpha 6: TypeScript cannot find HammerManager ... Been using alpha 5-2 along with Angular 2 rc.3 with no issues....
Read more >Cannot find name 'HammerManager' - angular - Stack Overflow
When I try to compile it throws an error, Cannot find name 'HammerManager'. Please see attached screenshot. Errors. I found some solution for...
Read more >angular/material2 - Gitter
getting error cannot find name HammerManager. Im using the latest Angular and material libraries. here is my package.json.
Read more >Cannot Find Name 'Hammermanager' - ADocLib
Error after upgrade to alpha 6: TypeScript cannot find HammerManager Fantashit January error TS2304: Cannot find name 'HammerManager'.
Read more >Solution working Hammer.js after upgrading to angular 9
js, swipe event is not working. I am not sure what i am missing. I am seeing this warning in chrome console -...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same here none of the mentioned solutions worked for me.
alpha.7 versions and, angular-cli@webpack and RC5 versions
I first noticed and reported this error after the upgrade from
alpha 5
toalpha 6
. Now, after upgrading toalpha 7
, it still occurs during Typescript compilationAs a workaround:
hammerjs
typing. Add the following totypings.json
npm run typings install
main.ts
file (adjust the path to get tohammerjs/index.d.ts
)