question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StaticInjectorError for TooltipService

See original GitHub issue

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

Current behavior Current version of ngx-graph throws error to the console and the graph won’t render when --aot build used, therefore we cannot turn on aot nor build optimizer for production builds.

  StaticInjectorError(Platform: core)[TooltipService -> InjectionService]: 
    NullInjectorError: No provider for InjectionService!
    at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:3228)
    at resolveToken (core.js:3473)
    at tryResolveToken (core.js:3417)
    at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:3314)
    at resolveToken (core.js:3473)
    at tryResolveToken (core.js:3417)
    at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:3314)
    at resolveNgModuleDep (core.js:19784)
    at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (core.js:20473)
    at resolveDep (core.js:20844)

It doesn’t matter if I use tooltips or not in the graph the above mentioned error exists for both cases.

Expected behavior The grap should be rendered correctly and the app should not throw any error.

Reproduction of the problem Integrate ngx-graph in your app following the provided readme and try to ether run ng serve --aot or create a production angular build.

Please tell us about your environment: npm 6.4.1, Angular CLI 7.1.3, webpack 4.26.0

  • ngx-graph version: 5.1.1 but 5.2.1 also affected
  • Angular version: 7.1.3
  • Browser: all
  • Language: all

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:16

github_iconTop GitHub Comments

3reactions
nikolovskicommented, Feb 7, 2019

@jadielam Provide InjectionService in AppModule

@NgModule({
declarations: [...],
imports: [...],
providers: [InjectionService]
2reactions
JoWood94commented, Feb 10, 2020

Facing the same issue and tried all the solution linked before, "@angular/core": "~8.2.14", "@swimlane/ngx-charts": "12.0.1", "@swimlane/ngx-graph": "^6.2.0", Does anyone have the solution?? adding or removing the modules (graph and chart) doesn’t seem to solve nothing and neither adding the InjectionService to the providers 😕

Read more comments on GitHub >

github_iconTop Results From Across the Web

No provider for InjectionService using AOT - Stack Overflow
The error : ERROR NullInjectorError: StaticInjectorError(AppModule)[TooltipService -> InjectionService]: StaticInjectorError( ...
Read more >
Bountysource
Error: StaticInjectorError(AppServerModule)[TooltipService -> InjectionService]:
Read more >
No Provider For Injectionservice Using Aot - ADocLib
The error : ERROR NullInjectorError: StaticInjectorErrorAppModule[TooltipService InjectionService]: StaticInjectorError. Providers in Angular are key to how ...
Read more >
NullInjectorError: No provider for InjectionService using AOT
The error : ERROR NullInjectorError: StaticInjectorError(AppModule)[TooltipService -> InjectionService]: StaticInjectorError(Platform: core)[TooltipService -> ...
Read more >
NullInjectorError: No provider for function(){}! - AngularFix
Uncaught Error: StaticInjectorError(Platform: core)[function(){}]: ... register services at root level providers: [ TooltipService, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found