Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injection error for NgxPendoService #51

Closed
nalex-wise opened this issue Apr 11, 2022 · 1 comment
Closed

Injection error for NgxPendoService #51

nalex-wise opened this issue Apr 11, 2022 · 1 comment

Comments

@nalex-wise
Copy link

Angular 13 - trying to use this component, and getting an injection error:

import { NgxPendoService } from 'ngx-pendo';

...

constructor(private featureFlagsService: FeatureFlagsService,
private tokenService: TokenService,
protected pendoService: NgxPendoService ) {

==============================================

ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[NgxPendoService -> NgxPendoService -> NgxPendoService]:
NullInjectorError: No provider for NgxPendoService!
NullInjectorError: R3InjectorError(AppModule)[NgxPendoService -> NgxPendoService -> NgxPendoService]:
NullInjectorError: No provider for NgxPendoService!
at NullInjector.get (core.mjs:11095:1)
at R3Injector.get (core.mjs:11262:1)
at R3Injector.get (core.mjs:11262:1)
at R3Injector.get (core.mjs:11262:1)
at NgModuleRef.get (core.mjs:21807:1)
at Object.get (core.mjs:21484:1)
at lookupTokenUsingModuleInjector (core.mjs:3334:1)
at getOrCreateInjectable (core.mjs:3446:1)
at Module.ɵɵdirectiveInject (core.mjs:14381:1)
at NodeInjectorFactory.PendoAnalyticsComponent_Factory [as factory] (pendo-analytics.component.ts:13:37)
at resolvePromise (zone.js:1213:1)
at resolvePromise (zone.js:1167:1)
at zone.js:1279:1
at ZoneDelegate.invokeTask (zone.js:406:1)
at Object.onInvokeTask (core.mjs:25444:1)
at ZoneDelegate.invokeTask (zone.js:405:1)
at Zone.runTask (zone.js:178:1)
at drainMicroTaskQueue (zone.js:582:1)
at ZoneTask.invokeTask [as invoke] (zone.js:491:1)
at invokeTask (zone.js:1600:1)

Also, it's not clear - does the code snippet in the still required? I tried it both ways without success.

The IDE can find NgxPendoService just fine and shows no errors. Does the service need to be added in a separate place?

Thanks

@yociduo
Copy link
Owner

yociduo commented Jul 27, 2022

Do you configure the module?

https://github.com/yociduo/ngx-pendo#simple-configuration

@yociduo yociduo closed this as completed Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants