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.

index.d.ts, found version 4, expected 3.. and Cannot read property 'length' of undefined at LineChartComponen

See original GitHub issue

trying to implementing <ngx-charts-line-chart> but getting this error:

ERROR in Metadata version mismatch for module C:/Users/Pawel/desktop/code/pami/node_modules/@swimlane/ngx-charts/release /index.d.ts, found version 4, expected 3, resolving symbol AppModule in C:/Users/Pawel/desktop/code/pami/src/app/app.mod ule.ts, resolving symbol AppModule in C:/Users/Pawel/desktop/code/pami/src/app/app.module.ts

as well ass:

TypeError: Cannot read property ‘length’ of undefined at LineChartComponent…/src/line-chart/line-chart.component.ts.LineChartComponent.getXDomain…

package.json:


> `{
>   "name": "pami",
>   "version": "0.0.0",
>   "license": "MIT",
>   "scripts": {
>     "ng": "ng",
>     "start": "ng serve",
>     "build": "ng build",
>     "test": "ng test",
>     "lint": "ng lint",
>     "e2e": "ng e2e"
>   },
>   "private": true,
>   "dependencies": {
>     "@angular/animations": "^5.0.2",
>     "@angular/common": "^4.0.0",
>     "@angular/compiler": "^4.0.0",
>     "@angular/core": "^4.0.0",
>     "@angular/forms": "^4.0.0",
>     "@angular/http": "^4.0.0",
>     "@angular/platform-browser": "^4.0.0",
>     "@angular/platform-browser-dynamic": "^4.0.0",
>     "@angular/router": "^4.0.0",
>     "@firebase/webchannel-wrapper": "0.2.3",
>     "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.5",
>     "@swimlane/ngx-charts": "^7.0.0",
>     "angularfire2": "^5.0.0-rc.2",
>     "bootstrap": "^4.0.0-alpha.6",
>     "bootswatch": "^4.0.0-beta.2",
>     "core-js": "^2.4.1",
>     "d3": "^4.11.0",
>     "firebase": "^4.5.0",
>     "font-awesome": "^4.7.0",
>     "ng-sidebar": "^6.0.2",
>     "promise-polyfill": "6.0.2",
>     "rxjs": "^5.1.0",
>     "zone.js": "^0.8.4"
>   },
>   "devDependencies": {
>     "@angular/cli": "1.0.1",
>     "@angular/compiler-cli": "^4.0.0",
>     "@types/jasmine": "2.5.38",
>     "@types/node": "~6.0.60",
>     "codelyzer": "~2.0.0",
>     "jasmine-core": "~2.5.2",
>     "jasmine-spec-reporter": "~3.2.0",
>     "karma": "~1.4.1",
>     "karma-chrome-launcher": "~2.0.0",
>     "karma-cli": "~1.0.1",
>     "karma-jasmine": "~1.1.0",
>     "karma-jasmine-html-reporter": "^0.2.2",
>     "karma-coverage-istanbul-reporter": "^0.2.0",
>     "protractor": "~5.1.0",
>     "ts-node": "~2.0.0",
>     "tslint": "~4.5.0",
>     "typescript": "~2.2.0"
>   }
> }
> `

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ghostcommented, Nov 17, 2017

My error was:

ERROR in Error: Metadata version mismatch for module C:/temp/chartsTest/something/node_modules/@swimlane/ngx-charts/release/index.d.ts, found version 4, expected 3, resolving symbol AppModule in C:/temp/chartsTest/something/src/app/app.module.ts, resolving symbol AppModule in C:/temp/chartsTest/something/src/app/app.module.ts

at syntaxError (C:\temp\chartsTest\something\node_modules\@angular\compiler\bundles\compiler.umd.js:1729:34)
at simplifyInContext (C:\temp\chartsTest\something\node_modules\@angular\compiler\bundles\compiler.umd.js:24979:23)
at StaticReflector.simplify (C:\temp\chartsTest\something\node_modules\@angular\compiler\bundles\compiler.umd.js:24991:13)
at StaticReflector.annotations (C:\temp\chartsTest\something\node_modules\@angular\compiler\bundles\compiler.umd.js:24418:41)
at _getNgModuleMetadata (C:\temp\chartsTest\something\node_modules\@angular\compiler-cli\src\ngtools_impl.js:138:31)
at _extractLazyRoutesFromStaticModule (C:\temp\chartsTest\something\node_modules\@angular\compiler-cli\src\ngtools_impl.js:109:26)
at Object.listLazyRoutesOfModule (C:\temp\chartsTest\something\node_modules\@angular\compiler-cli\src\ngtools_impl.js:53:22)
at Function.NgTools_InternalApi_NG_2.listLazyRoutes (C:\temp\chartsTest\something\node_modules\@angular\compiler-cli\src\ngtools_api.js:91:39)
at AotPlugin._getLazyRoutesFromNgtools (C:\temp\chartsTest\something\node_modules\@ngtools\webpack\src\plugin.js:212:44)
at _donePromise.Promise.resolve.then.then.then.then.then (C:\temp\chartsTest\something\node_modules\@ngtools\webpack\src\plugin.js:448:24)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
2reactions
GaetanWicommented, Nov 17, 2017

@neo-xy I’m using Angular 4.0.2, and I needed to use ngx-charts in it’s 6.0.2 version to avoid this mismatch error. 6.1.0 seems to be for Angular 4.3 and higher and 7.0.0 seems to be for Angular 5.0

The undefined errormight be code related issue on your side sending the wrong data to the chart. For this chart, the library expect a multi data sample and not a simple one as you can see here : https://swimlane.gitbooks.io/ngx-charts/content/charts/line-chart.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

Highest scored 'ngx-charts' questions - Page 5 - Stack Overflow
[sm]:1 ERROR TypeError: Cannot read property 'map' of undefined. This is the content of stock_inf.ts file(Actually there are bigger and different arrays, ...
Read more >
Baljeet Singh on Tumblr
In simple terms, they're a set of data that can be appended to but can't be edited or deleted. Think of it as...
Read more >
Why is uncaught TypeError cannot read property of undefined?
How to fix the cannot read property ” values ” error? ... In Firefox Version 19 I get the error “TypeError: o is...
Read more >
The ngx-echarts from xieziyu - Coder Social
An angular (ver >= 2.x) directive for ECharts (ver >= 3.x) from Coder Social. ... 1.2.3版本安装的包下有index.ts 和index.js ,typescript 下引入的是index.ts ...
Read more >
angular/angular - Gitter
is that to be expected. Rob. @borriej. Apr 10 2018 16:42 UTC. can any one help me out here? im not working with...
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