brtnshrdr / angular2-hotkeys

Keyboard shortcuts for Angular 2 apps
MIT License
203 stars 95 forks source link

Cannot find name 'MousetrapInstance' - issue fixed for angular v7 #143

Closed JaiKumaresh closed 3 years ago

JaiKumaresh commented 3 years ago

I have the below error in my angular(v7.1.4) project.

ERROR in src/app/app.module.ts(13,46): error TS2307: Cannot find module 'angular2-hotkeys'.
src/app/services/base/base.service.ts(6,40): error TS2307: Cannot find module 'angular2-hotkeys'.

So I add this pull request in angular2-hotkeys v2.1.4 the last commit. If you have anything alternative way Kindly share me.

d3-vitalii-baziuk commented 3 years ago

@JaiKumaresh pls close your PR. It's resolved in https://www.npmjs.com/package/angular2-hotkeys v2.3.1

Coffee-Tea commented 3 years ago

It's resolved in https://www.npmjs.com/package/angular2-hotkeys v2.3.1

Jai-Kumaresh commented 3 years ago

But I have ERROR in node_modules/angular2-hotkeys/lib/hotkey.model.d.ts(24,9): error TS1086: An accessor cannot be declared in an ambient context. this error now. Kindly tell me this solution. @d3-vitalii-baziuk @Coffee-Tea

Coffee-Tea commented 3 years ago

@Jai-Kumaresh when do u have that: during serving or build?? Have you installed 2.3.1? what version of Angular are u using?

Jai-Kumaresh commented 3 years ago

@Jai-Kumaresh when do u have that: during serving or build?? Have you installed 2.3.1? what version of Angular are u using?

Installed. I run serve then I got this error.

Coffee-Tea commented 3 years ago

Got it, it's still not working for Angular 7. Are u using Angular 7?

Jai-Kumaresh commented 3 years ago

image

@d3-vitalii-baziuk Check this line. If you have the solution Kindly tell me.

Coffee-Tea commented 3 years ago

ok, the previous Collaborator did some updates in v.2.1.5 during migration to Angular 8.

but most of the people got into the issue in v2.2.0 and couldn't use this lib in newer versions. So, to be honest I think that's the latest compatible version with Angular 7 is v2.1.4. There is no MousetrapInstance issue in v2.1.4.

If u migrate your project to Angular 8 or higher just use v2.3.1.

Coffee-Tea commented 3 years ago

let me know if it's clear and I can close.