moribvndvs / ng2-idle

Responding to idle users in Angular (not AngularJS) applications.
https://moribvndvs.github.io/ng2-idle
Apache License 2.0
315 stars 128 forks source link

My app stopped loading after installing @ng-idle #98

Open zbeedatm opened 6 years ago

zbeedatm commented 6 years ago

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/HackedByChinese/ng2-idle/blob/master/CONTRIBUTING.md#getting-help

Current behavior

Getting exception:

ERROR Error: StaticInjectorError(AppModule)[Keepalive -> HttpClient]: StaticInjectorError(Platform: core)[Keepalive -> HttpClient]: NullInjectorError: No provider for HttpClient! at _NullInjector.webpackJsonp.../../../core/esm5/core.js._NullInjector.get (core.js:1003) at resolveToken (core.js:1301) at tryResolveToken (core.js:1243) at StaticInjector.webpackJsonp.../../../core/esm5/core.js.StaticInjector.get (core.js:1111) at resolveToken (core.js:1301) at tryResolveToken (core.js:1243) at StaticInjector.webpackJsonp.../../../core/esm5/core.js.StaticInjector.get (core.js:1111) at resolveNgModuleDep (core.js:10896) at _createClass (core.js:10933) at _createProviderInstance$1 (core.js:10907)

Expected behavior

App should load as it was before installing this package

Minimal reproduction of the problem with instructions

Followed this example: https://hackedbychinese.github.io/ng2-idle/ and tried to load app, but it failed.

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Angular5 / Windows

zbeedatm commented 6 years ago

Solved by adding HttpClientModule to my app.module.ts

Pls update the example page with this instruction for angular5

nabanita- commented 6 years ago

Added HttpClientModule, even HttpModule in AppModule but still facing this error.

sarikonduri commented 5 years ago

Adding HttpClientModule/HttpModule did not help me. If there any solution?

plisovyi commented 5 years ago

@sarikonduri instruction on https://hackedbychinese.github.io/ng2-idle/ misses only adding HttpClientModule to root module's imports. Here's it my StackBlitz example — https://stackblitz.com/edit/ng-idle-issue-98 — what's in instruction but with HttpClientModule.

If you need more assistance, please, try replicating your issue in StackBlitz, it would make helping easier.

@HackedByChinese I think this issue is resolved and can be closed, but instruction needs an update. Can you maybe point me at its source files so I can prepare pull request?