Property ? is missing in wrong type
See original GitHub issueI’m seeing a regression where code that works in 3.1 does not work in tsnext. It seems like typescript is not looking at the right type (ContourTransform
) and tried to match against a different type (WordcloudTransform
).
TypeScript Version: @next (3.2) but not 3.1
Search Terms: Property ? is missing in type
Code
https://github.com/vega/vega-typings/blob/master/tests/spec/examples.ts#L3394
Expected behavior:
The tests should not fail and they work fine in ts 3.1.
Actual behavior:
https://travis-ci.org/vega/vega-typings/jobs/444180003
ERROR: 3394:3 expect TypeScript@next compile error:
Type '({ name: string; url: string; transform: { type: "filter"; expr: string; }[]; } | { name: string; source: string; transform: { type: "contour"; x: { expr: string; }; y: { expr: string; }; size: { signal: string; }[]; count: { ...; }; }[]; })[]' is not assignable to type 'Data[]'.
Type '{ name: string; url: string; transform: { type: "filter"; expr: string; }[]; } | { name: string; source: string; transform: { type: "contour"; x: { expr: string; }; y: { expr: string; }; size: { signal: string; }[]; count: { ...; }; }[]; }' is not assignable to type 'Data'.
Type '{ name: string; source: string; transform: { type: "contour"; x: { expr: string; }; y: { expr: string; }; size: { signal: string; }[]; count: { signal: string; }; }[]; }' is not assignable to type 'Data'.
Type '{ name: string; source: string; transform: { type: "contour"; x: { expr: string; }; y: { expr: string; }; size: { signal: string; }[]; count: { signal: string; }; }[]; }' is not assignable to type '{ url: string | SignalRef; } & { name: string; on?: OnTrigger[] | undefined; format?: FormatJSON | FormatSV | FormatDSV | ({ type: "topojson"; property?: string | undefined; } & { ...; }) | ({ ...; } & { ...; }) | { ...; } | SignalRef | undefined; transform?: Transform[] | undefined; }'.
Type '{ name: string; source: string; transform: { type: "contour"; x: { expr: string; }; y: { expr: string; }; size: { signal: string; }[]; count: { signal: string; }; }[]; }' is not assignable to type '{ url: string | SignalRef; }'.
Property 'url' is missing in type '{ name: string; source: string; transform: { type: "contour"; x: { expr: string; }; y: { expr: string; }; size: { signal: string; }[]; count: { signal: string; }; }[]; }'.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Property is missing in type error - reactjs - Stack Overflow
When I run this I get errors pertaining to the interface. ERROR in ./app/app.tsx (38,17): error TS2324: Property 'humans' is missing in type...
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 >SyntaxError: missing ; before statement - JavaScript | MDN
The JavaScript exception "missing ; before statement" occurs when there is a semicolon (;) missing somewhere and can't be added by automatic semicolon ......
Read more >Required parameters are missing or of wrong types
Meaning: A required parameter is missing or the parameter is the wrong type. The wrong information is being passed to the routine. Recovery:...
Read more >Troubleshoot Azure Cosmos DB bad request exceptions
In this article. Missing the ID property; Invalid partition key type; Wrong partition key value; Next steps. APPLIES TO: NoSQL.
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
Minimal example:
In this case it just means that we need to investigate from the beginning to see what’s causing the problem - for most bugs it’s evident from the behavior, but I’m unsure here.