0

I want to use ng-idle/ng-keepalive in my angular 8 project, I tried installing many versions of them, but in console it is showing this error only

Error: Uncaught (in promise): TypeError: Object(...) is not a function TypeError: Object(...) is not a function at eval (eventtargetinterruptsource.js:39:70)

Can you tell me which version should i install that would be compatible with Angular version 8

I installed the version for ng-idle/keepalive by using this version guide

  • Which version of ng-idle/keepalive did you install? – Julian W. Jul 10 '23 at 02:58
  • i tried installing the 8,7,6 versions provided in this [link](https://www.npmjs.com/package/@ng-idle/core?activeTab=versions) and recently i installed 2.0.0-beta.15 – Salvi Rawat Jul 10 '23 at 03:02

1 Answers1

0

You should use v8.0.0-beta.4.

You can check the compatible version of most of npm libraries by following these steps.

  1. Go to GitHub source repository. In this case, it's https://github.com/moribvndvs/ng2-idle
  2. Open package.json file and check which version of angular is this library's latest version compatible with. "dependencies" -> "@angular/core"
  3. If it is not the version you want, you try to switch to another tag from Switch branches/tags dropdown.enter image description here
Julian W.
  • 1,501
  • 7
  • 20
  • thanks for this insight. I was mistaken about the angular version I am using. I am using angular 5, so i installed ng-idle/keepalive [this](npm install --save @ng-idle/core@2.0.0-beta.15 @ng-idle/keepalive@2.0.0-beta.15). Now it is not showing that error. But the code I implemented for ng-idle is not working. Do i have to change the import also? right now i am importing this way : import { NgIdleKeepaliveModule } from '@ng-idle/keepalive'; NgIdleKeepaliveModule.forRoot() – Salvi Rawat Jul 10 '23 at 05:44
  • import { Idle, DEFAULT_INTERRUPTSOURCES } from '@ng-idle/core'; import { Keepalive } from '@ng-idle/keepalive'; Please help. Thanks – Salvi Rawat Jul 10 '23 at 05:45
  • @SalviRawat, please follow steps in https://github.com/moribvndvs/ng2-idle-example – Julian W. Jul 10 '23 at 13:48