0

I have an application that works well under Angular 12. This application includes the use of google charts

It keeps erroring on the build.

To try to demonstrate the error I built a tutorial using only a very basic test. When I try to build this test application in Angular 15 I keep getting this message:

Error: app.component.html:4:6 - error TS2322: Type 'string' is not assignable to type 'ChartType'.

4     [type]="chartData.type"
       ~~~~

  app.component.ts:5:16
    5   templateUrl: './app.component.html',
                     ~~~~~~~~~~~~~~~~~~~~~~
    Error occurs in the template of component AppComponent.

Here is a copy provided by ng v:

Angular CLI: 15.0.5
Node: 18.12.1
Package Manager: npm 9.3.0
OS: linux x64

Angular: 15.2.9
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1502.8
@angular-devkit/build-angular   15.2.8
@angular-devkit/core            15.2.8
@angular-devkit/schematics      15.0.5
@angular/cli                    15.0.5
@schematics/angular             15.0.5
rxjs                            7.5.7
typescript                      4.8.4
stoshb
  • 65
  • 1
  • 11
  • did you update your charts library also ? – Navitas28 May 25 '23 at 13:42
  • Yes, And this issue occurs on a brand new application. – stoshb May 27 '23 at 13:47
  • Then the probem is your `type` variable is excepting different type of data which you are providing for testing you can make chartData.type as any and see is type mismatch is the problem if yes then you can check the type and make it correct – Navitas28 May 27 '23 at 14:43

0 Answers0