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.

[5.0.0] types/dist/echarts.d.ts is invalid and won't compile

See original GitHub issue

Version

5.0.0

Steps to reproduce

So, I wanted to switch to echarts@5.0.0 since the whole codebase had been migrated to TypeScript but it seems that types/dist/echarts.d.ts can’t be built properly. I’ve tried it in my Angular 11 project and a simple node project with just TypeScript installed. I also pasted the code of types/dist/echarts.d.ts into the TypeScript Playground and get the same errors.

These are some of the errors I’m getting (I left out the ones with long traces):

Error: node_modules/echarts/types/dist/echarts.d.ts:1568:46 - error TS2339: Property 'rotate' does not exist on type 'AxisLabelOption | undefined'.

1568         rotate?: AxisBaseOption['axisLabel']['rotate'];
                                                  ~~~~~~~~
node_modules/echarts/types/dist/echarts.d.ts:2034:5 - error TS2411: Property 'itemId' of type 'string | number | (string | number)[] | undefined' is not assignable to string index type 'OptionEncodeValue'.

2034     [coordDim: string]: OptionEncodeValue;
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/echarts/types/dist/echarts.d.ts:2034:5 - error TS2411: Property 'itemName' of type 'string | number | (string | number)[] | undefined' is not assignable to string index type 'OptionEncodeValue'.

2034     [coordDim: string]: OptionEncodeValue;
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/echarts/types/dist/echarts.d.ts:2034:5 - error TS2411: Property 'label' of type 'string | number | (string | number)[] | undefined' is not assignable to string index type 'OptionEncodeValue'.

2034     [coordDim: string]: OptionEncodeValue;
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/echarts/types/dist/echarts.d.ts:2034:5 - errorm TS2411: Property 'seriesName' of type 'string | number | (string | number)[] | undefined' is not assignable to string index type 'OptionEncodeValue'.

2034     [coordDim: string]: OptionEncodeValue;
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/echarts/types/dist/echarts.d.ts:2034:5 - error TS2411: Property 'tooltip' of type 'string | number | (string | number)[] | undefined' is not assignable to string index type 'OptionEncodeValue'.

2034     [coordDim: string]: OptionEncodeValue;
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/echarts/types/dist/echarts.d.ts:3318:49 - error TS2339: Property 'focus' does not exist on type '(GraphNodeStateOption & ExtraEmphasisState & { blurScope?: "global" | "series" | "coordinateSystem" | undefined; }) | undefined'.

3318         focus?: GraphNodeItemOption['emphasis']['focus'];
                                                     ~~~~~~~
3841 interface ToolboxMagicTypeFeatureOption extends ToolboxFeatureOption {
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/echarts/types/dist/echarts.d.ts:4011:9 - error TS2411: Property 'brush' of type 'ToolboxBrushFeatureOption | undefined' is not assignable to string index type 'ToolboxFeatureOption | { [key: string]: any; }'.

4011         brush?: ToolboxBrushFeatureOption;
             ~~~~~
node_modules/echarts/types/dist/echarts.d.ts:4012:9 - error TS2411: Property 'dataView' of type 'ToolboxDataViewFeatureOption | undefined' is not assignable to string index type 'ToolboxFeatureOption | { [key: string]: any; }'.

4012         dataView?: ToolboxDataViewFeatureOption;
             ~~~~~~~~
node_modules/echarts/types/dist/echarts.d.ts:4013:9 - error TS2411: Property 'dataZoom' of type 'ToolboxDataZoomFeatureOption | undefined' is not assignable to string index type 'ToolboxFeatureOption | { [key: string]: any; }'.

4013         dataZoom?: ToolboxDataZoomFeatureOption;
             ~~~~~~~~
node_modules/echarts/types/dist/echarts.d.ts:4014:9 - error TS2411: Property 'magicType' of type 'ToolboxMagicTypeFeatureOption | undefined' is not assignable to string index type 'ToolboxFeatureOption | { [key: string]: any; }'.

4014         magicType?: ToolboxMagicTypeFeatureOption;
             ~~~~~~~~~
node_modules/echarts/types/dist/echarts.d.ts:4015:9 - error TS2411: Property 'restore' of type 'ToolboxRestoreFeatureOption | undefined' is not assignable to string index type 'ToolboxFeatureOption | { [key: string]: any; }'.

4015         restore?: ToolboxRestoreFeatureOption;
             ~~~~~~~
node_modules/echarts/types/dist/echarts.d.ts:4016:9 - error TS2411: Property 'saveAsImage' of type 'ToolboxSaveAsImageFeatureOption | undefined' is not assignable to string index type 'ToolboxFeatureOption | { [key: string]: any; }'.

4016         saveAsImage?: ToolboxSaveAsImageFeatureOption;
             ~~~~~~~~~~~

Am I missing anything?

What is expected?

There should not to be any compiler errors.

What is actually happening?

There are a lot of compiler errors.


Node Version: 14.15.1 / 12.16.1

TypeScript Version: 4.0.5

Issue Analytics

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

github_iconTop GitHub Comments

7reactions
pissangcommented, Dec 25, 2020

@monilyn In one or two weeks

2reactions
pissangcommented, Dec 21, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

[5.0.0] types/dist/echarts.d.ts is invalid and won't compile #13850
I've tried it in my Angular 11 project and a simple node project with just TypeScript installed. I also pasted the code of...
Read more >
Angular/webpack not looking for .d.ts file in @spartacus ...
While creating a Spartacus component, I have come across errors where specific Spartacus .d.ts definition files cannot be resolved.
Read more >
Understanding TypeScript's “Compilation Process” & the ...
When a glob pattern doesn't have a file extension, TypeScript looks for the files ending with .ts or .d.ts extension in the directory ......
Read more >
Typescript does not resolve modules through tsconfig.json's ...
So,it doesn't use settings in your tsconfig.json when compiling your files, it uses default TS options instead.
Read more >
Solved: TypeScript compile errors - Esri Community
ChainExpression & NodeParentExtension) => void) | undefined;. node_modules/@types/eslint/index.d.ts:474:43 - error TS2694: Namespace '"C:/Users/ ...
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