xieziyu / ngx-echarts

An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
https://xieziyu.github.io/ngx-echarts/
MIT License
1.11k stars 197 forks source link

After updating from 16.0.0 to 16.1.0 I get compilation errors using angular #405

Closed JakobMadsen717 closed 1 year ago

JakobMadsen717 commented 1 year ago

After updating from 16.0.0 to 16.1.0 I get compilation errors using angular. If I revert to 16.0.0 all works fine.

Angular CLI: 16.2.6 Node: 18.18.0 Package Manager: npm 9.8.1 OS: linux x64

Angular: 16.2.8 ... animations, common, compiler, compiler-cli, core, forms ... platform-browser, platform-browser-dynamic, router ... service-worker

Package Version

@angular-devkit/architect 0.1602.6 @angular-devkit/build-angular 16.2.6 @angular-devkit/core 16.2.6 @angular-devkit/schematics 16.2.6 @angular/cli 16.2.6 @angular/fire 7.6.1 @angular/google-maps 16.2.7 @schematics/angular 16.2.6 rxjs 7.8.1 typescript 5.1.6 zone.js 0.13.3

  • Generating browser application bundles (phase: setup)... ✔ Browser application bundle generation complete. ✔ Browser application bundle generation complete.

Error: node_modules/echarts/types/src/animation/basicTransition.d.ts:54:58 - error TS2344: Type 'Props' does not satisfy the constraint 'ElementProps'.

54 export declare function removeElement(el: Element, props: Props, animatableModel?: Model, dataIndex?: AnimateOrSetPropsOption['dataIndex'] | AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption, cb?: AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption['during'], during?: AnimateOrSetPropsOption['during']): void;


  node_modules/echarts/types/src/animation/basicTransition.d.ts:54:39
    54 export declare function removeElement<Props>(el: Element<Props>, props: Props, animatableModel?: Model<AnimationOptionMixin>, dataIndex?: AnimateOrSetPropsOption['dataIndex'] | AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption, cb?: AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption['during'], during?: AnimateOrSetPropsOption['during']): void;
This type parameter might need an `extends ElementProps` constraint.

Error: node_modules/echarts/types/src/chart/bar/BarSeries.d.ts:44:5 - error TS2416: Property 'coordinateSystem' in type 'BarSeriesModel' is not assignable to the same property in base type 'BaseBarSeriesModel'. Type 'Cartesian2D | Polar' is not assignable to type 'CoordinateSystem'. Type 'Cartesian2D' is not assignable to type 'CoordinateSystem'. Types of property 'master' are incompatible. Type 'Grid' is not assignable to type 'CoordinateSystemMaster'.

44 coordinateSystem: Cartesian2D | Polar;


Error: node_modules/echarts/types/src/chart/bar/BaseBarSeries.d.ts:41:56 - error TS2344: Type 'unknown' does not satisfy the constraint 'StatesMixinBase'.

41     static defaultOption: BaseBarSeriesOption<unknown, unknown>;

...

xieziyu commented 1 year ago

What is the version of echarts?

JakobMadsen717 commented 1 year ago

The version that gives compilation errors is ngx-echarts version 16.1.0. If I revert to ngx-echarts version 16.0.0 there are no compilation errors.

xieziyu commented 1 year ago

I mean the ECharts version. Maybe you can update echarts to v5.4.3?

JakobMadsen717 commented 1 year ago

Oh, sorry, misunderstood, I am using echarts@5.4.3

xieziyu commented 1 year ago

Thank you. Can you try this ngx-echarts@16.1.1-alpha.1 patch?

JakobMadsen717 commented 1 year ago

Yes, that works like a charm. It compiles fine, and my charts look great. Thanks xieziyu, I will use 16.1.1 when it gets released.

xieziyu commented 1 year ago

Great to know. 16.1.1 is released. I will close this.

cgomezrubial commented 11 months ago

Same error here, using versions "echarts": "^5.4.1" and "ngx-echarts": "^15.0.3",

Angular CLI: 15.2.10 Node: 16.14.2 Package Manager: npm 8.5.0 OS: win32 x64

Package Version @angular-devkit/architect 0.1502.10 @angular-devkit/build-angular 15.2.10 @angular-devkit/core 15.2.10 @angular-devkit/schematics 15.2.10 @angular/cdk 15.2.9 @angular/fire 7.6.1 @angular/material 15.2.9 @angular/material-moment-adapter 15.2.9 @schematics/angular 15.2.10 rxjs 7.8.1 typescript 4.9.5

cgomezrubial commented 11 months ago

More information about that.

This only happens having activated strict mode on typescript compilator. If i set "strict": false on tsconfig.json the problem dissapear.

I can create other issue if you prefer.