bearnithi / bn-ng-idle

Angular user idle detector service
28 stars 11 forks source link

TypeError: Object(...) is not a function #7

Closed Arthi93 closed 4 years ago

Arthi93 commented 4 years ago

Hello,

on Angular 7 after installation i got this error:

TypeError: Object(...) is not a function. From googling it I assume its version incompatibility but im using 1.0.1. Any advices? Im using just the basic method:

 `this.bnIdle.startWatching(environment.sessionTimeout).subscribe((expired) => {
    if (expired) {
    ...
    }
});`
Perminus-Gaita commented 4 years ago

I have the same problem... I guess I'll just use another package.

Arthi93 commented 4 years ago

Yeah, switched to https://github.com/moribvndvs/ng2-idle and it works without a problem

bearnithi commented 4 years ago

Upgrading your rxjs version to latest one. that is rxjs 6. That will solve the issue.

npm i rxjs@^6.0 rxjs-compat

please try the above method. If it doesn't work let me know. This package supports especially for latest angular version that is angular 8 and 9. but it supports older version too by upgrading the rxjs package.