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.

Error: StaticInjectorError(AppServerModule)[TooltipService -> InjectionService]:

See original GitHub issue

I’m submitting a … (check one with “x”)

  • bug report - search github for a similar issue or PR before submitting
  • feature request
  • support request - use StackOverflow (add the ngx-charts tag) or the gitter chat for support questions

Current behavior When running angular 6 app with universal the server side code reports the mentioned injector error. It doesn’t break the app tho.

ERROR { Error: Uncaught (in promise): Error: StaticInjectorError(AppServerModule)[TooltipService -> InjectionService]:
  StaticInjectorError(Platform: core)[TooltipService -> InjectionService]:
    NullInjectorError: No provider for InjectionService!

For now I stopped this error by putting an ngIf on the html element to only show if platform is browser.

Expected behavior

Reproduction of the problem

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

Please tell us about your environment: Using angular universal express setup and ngx-charts-bar-vertical-2d in html template.

  • ngx-charts version: 9.0.0

  • Angular version: 6.1.0

  • Browser: terminal

  • Language: Typescript

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:12
  • Comments:11

github_iconTop GitHub Comments

6reactions
romainpurchlacommented, Nov 28, 2018

I have same problem. My workaround for that is used this --aot=false --build-optimizer=false for build in prod.

3reactions
muradmcommented, Dec 8, 2018

After hours of battle, it seems to be definitely packaging issue. Porting @swimlane/ngx-charts to ng-packagr solves this issue, #18 and tons of other (and potential) issues 😃

@marjan-georgiev, porting to ng-packagr seems to be not so complex, with minimum code changes, may be should be considered? why not?

So far to make it working in my case:

  • project layout (not code layout)
  • imports of d3-* to d3
  • documentation annotations are not compatible comments which are mostly empty and removable
  • in few places imports to where defined
  • fixes:
    • undefined early references
    • window reference

Everything else works out of the box including tests, demo app etc. without any notable changes to user.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular SSR Serve Error NullInjectorError: StaticInjectorError ...
I have injected all services. I have injected all components. Error: ERROR Error [NullInjectorError]: StaticInjectorError(AppServerModule)[ ...
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