Ngx-charts: Error while building project : An accessor cannot be declared in an ambient context

Created on 15 Apr 2020  路  12Comments  路  Source: swimlane/ngx-charts

First of all Thank you for a great plugin, really appropriate it.
I had an issue with 13.0.2 Version where I was getting Kind of undefined as an error while trying prod build.
So I checked for it and found a new version released. I Updated the project and got a new error as below.

Error in Console
ERROR in node_modules/@swimlane/ngx-charts/lib/bar-chart/bar.component.d.ts(39,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/common/legend/legend-entry.component.d.ts(11,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/common/tooltip/tooltip.component.d.ts(19,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/common/tooltip/tooltip.directive.d.ts(30,17): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/common/tooltip/tooltip.directive.d.ts(31,17): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/common/count/count.directive.d.ts(17,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/common/count/count.directive.d.ts(18,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/common/count/count.directive.d.ts(19,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/common/count/count.directive.d.ts(20,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/common/count/count.directive.d.ts(21,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/common/count/count.directive.d.ts(22,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/common/svg-radial-gradient.component.d.ts(9,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/common/svg-radial-gradient.component.d.ts(10,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/number-card/number-card.component.d.ts(21,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/pie-chart/pie-label.component.d.ts(19,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/pie-chart/pie-label.component.d.ts(20,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/pie-chart/pie-label.component.d.ts(21,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/pie-chart/pie-label.component.d.ts(22,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@swimlane/ngx-charts/lib/pie-chart/pie-label.component.d.ts(23,9): error TS1086: An accessor cannot be declared in an ambient context.

Would really appreciate if I get solution on it 馃憤

ngx-charts version
13.0.3
ERROR IN BUILDING CHARTS

Bug Need More Info Needs Demo

Most helpful comment

12.1.0 Works fine with angular 8 if you guys are running 8 :) Had the same problem installing latest 13.0.3, but downgrading to 12.1.0 did the trick for now.

All 12 comments

My team and I are having the same issue , waiting for any solution.

my team and I are having same issue;
Issue was created from following this tutorial:https://medium.com/@swathisprasad/building-data-visualization-with-angular-and-ngx-charts-375942d49fd6

12.1.0 Works fine with angular 8 if you guys are running 8 :) Had the same problem installing latest 13.0.3, but downgrading to 12.1.0 did the trick for now.

i re-installed everything. I went down a rabbit hole; but got it to work in the end. htanks friend/

Can you guys help me get the Stable version for angular 7? as I am using 7 in my project.

@pranavghate30 Try specifying the version to be 11.2.0 - since in the changelog it says that >= 12 is angular 8, and >= 13 is angular 9.

@pranavghate30 @pabloppizarro @antleypk
I created a new angular cli app, installed ngx-charts, and setup a basic visualization as shown here: https://medium.com/@swathisprasad/building-data-visualization-with-angular-and-ngx-charts-375942d49fd6

I am no able to repo this issues. Does anyone have a broken example?

Here is my demo created using the cli and following the medium post: https://github.com/Hypercubed/ngx-charts-demo

I just republished 13.0.2 as 13.0.4. Please "upgrade" to 13.0.4 for angular versions <9. Otherwise please use 14.0.0.

Hi, Guys Sorry to reply late.

if I build the application using "ng build" It build the dist folder. but.

@vikre I tried with version 11.2.0 and then trying "ng build --prod" and still I get below error
image

Here is my package.json
image

@Hypercubed Even with Version 13.0.4 I get below error when I do ng build --prod
image

I am sorry I am new to angular framework.

I tried Increasing the Heap Size by running below command
node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --prod
and I got this error
image

Any updates on this? Not resolved for me until now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

emeric0101 picture emeric0101  路  3Comments

DZDomi picture DZDomi  路  4Comments

faisalnet5 picture faisalnet5  路  3Comments

ianfdk picture ianfdk  路  3Comments

merinshaji picture merinshaji  路  3Comments