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.

Property ? is missing in wrong type

See original GitHub issue

I’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:open
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mattmccutchencommented, Oct 24, 2018

Minimal example:

type Transform =
  ({ type: "contour"; size: [string]; } & ({ a?: number } | { b?: number }))
  | { type: "tree"; [k: string]: any; };

const transform: Transform = {
  type: 'contour',
  size: ['width'],
};
0reactions
weswighamcommented, Dec 13, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

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