Property 'type' is missing in type '{ name: string; data: any[]; }'
See original GitHub issueHi! I have a problem with Highcharts. Even with an example:
const c = new Chart({
chart: {
type: 'pie'
},
title: {
text: 'TEST'
},
series: [
{
name: 'test',
data: [1, 2, 3, 4, 5, 6]
}
]
});
Visual Studio Code highlights series
section with error:
Property 'type' is missing in type '{ name: string; data: number[]; }' but required in type 'SeriesXrangeOptions'
.
I can’t do ng serve
because of compilation errors. What am I doing wrong?
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
error TS2741: Property is missing in type - Stack Overflow
ERROR in services/user.service.ts(7,2): error TS2741: Property 'isEqual' is missing in type '{ firstName: string; lastName: string;}' but ...
Read more >Property is missing in type 'X' but required in type 'Y' | bobbyhadz
The TypeScript error "Property is missing in type but required in type" occurs when we do not set all of the properties an...
Read more >Typescript Type System: How Does it Really Work? Type ...
A key thing about the Typescript Type System is that most of the times it just works, but sometimes we get some surprising...
Read more >Documentation - Utility Types - TypeScript
Constructs an object type whose property keys are Keys and whose property values are Type . This utility can be used to map...
Read more >15 Typescript Mistakes To Avoid - SoftwareMill Tech Blog
This is another way that lets any type creep into our code. We would like to iterate over object properties: interface Dog {...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Workaround that works for me:
You have to declare a type of series. Now everything works fine.
I can confirm this workaround works!