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.

uncaught TypeError: Cannot read property 'Injectable' of undefined

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

On page render I am getting the following error:

caught TypeError: Cannot read property ‘Injectable’ of undefined at :3000/scripts.bundle.js:24 at Object…/src/common/tooltip/injection.service.ts (:3000/scripts.bundle.js:24) at e (:3000/scripts.bundle.js:24) at Object…/src/common/tooltip/tooltip.service.ts (:3000/scripts.bundle.js:24) at e (:3000/scripts.bundle.js:24) at Object…/src/common/tooltip/tooltip.directive.ts (:3000/scripts.bundle.js:24) at e (:3000/scripts.bundle.js:24) at Object…/src/common/tooltip/tooltip.module.ts (:3000/scripts.bundle.js:24) at e (:3000/scripts.bundle.js:24) at Object…/src/common/tooltip/index.ts (:3000/scripts.bundle.js:24)

That said the page render correctly and ngx-chart is showing properly.

Expected behavior

Reproduction of the problem

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

error shown in console on render.

Please tell us about your environment:

Angular CLI 1.4.3

ngx-charts version: x.x.x

@swimlane/ngx-charts”: “^6.1.0”,

Angular version: 2.x.x

4.4.4

Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Chrome 61

Language: [all | TypeScript X.X | ES6/7 | ES5] Typescript

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
tbadlovcommented, Nov 1, 2017

Great. I feel like I have seen somewhere in the documentation that you need to add the JS file to the angular-cli.json file. Anyhow, this issue is resolved for me. Thanks!

1reaction
marjan-georgievcommented, Nov 1, 2017

Importing the module is the way to do it.

import { NgxChartsModule } from '@swimlane/ngx-charts';

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'x' of undefined while reading a JSON ...
I am getting the error at the above condition, it says as below. ng:///AppModule/proComponent_Host.ngfactory.js:5 ERROR TypeError: Cannot read ...
Read more >
cannot read properties of undefined (reading 'injectable')
This error occurs when you attempt to access a property on an object that is undefined. In this case, the object you are...
Read more >
How to Avoid the Infamous "Cannot read properties of ... - Bitovi
That error message is telling you the function is returning undefined implicitly, but its return type does not include undefined in it. Awesome!...
Read more >
Msg: Unhandled Promise rejection: Cannot read properties of ...
My angular application has a class which detects network status: @Injectable({ providedIn: 'root' }) export class NetworkAutoSyncService ...
Read more >
How to fix this " Uncaught TypeError: Cannot read properties ...
How to fix this " Uncaught TypeError: Cannot read properties of undefined (reading 'mData') " · <WebMethod()> <ScriptMethod()> · Public Shared ...
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