Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

141
Views
How do I fix Vetur type error Typescript / Vue

I am likely missing something in the "TYPING" of my objects but despite my interface slot is coming up as an any type.

Property 'slot' does not exist on type '{ slot?: number[] | undefined; tile?: number[] | undefined; cardOne?: number | null | undefined; cardTwo?: number | null | undefined; }[]'.Vetur(2339)

enter image description here

interface TableMatchInterface {
  slot?: (number) [];
  tile?:  (number) [];
  cardOne?: (number)|null;
  cardTwo?: (number)|null;
}

What am I doing wrong?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Because you are adding the "?" symbol after the slot property, typescript inferred that the object property could have 2 values, either number[] or undefined. If you are really sure that you already have a real value and not an undefined one, you can use "!" to tell typescript to relax.

siteStore.tableMatch.slot[0]!

You can have a look about the "!" symbol here:

https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#non-null-assertion-operator-postfix-

about 4 years ago · Juan Pablo Isaza Report

0

The error indicates that tableMatch is an array of TableMatchInterface objects. Did you mean something like

siteStore.tableMatch[0].slot

Either that or check that the typing on tableMatch is actually TableMatchInterface, and not something like TableMatchInterface[]

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!