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

180
Views
how to fix typeError: cannot read properties of undefined (reading 'upload') in vue

I encountered this error in my program, what is the problem? (The files are correct).

:src="http://marketplus.io/${item.data.upload[0].link}"

  <div class="product-card">
    <div class="product-card-top">
      <NuxtLink :to="`/product/${item.id}`">
        <img v-if="item.data"
          class="w-100"
          :src="`http://marketplus.io/${item.data.upload[0].link}`"   
          alt="product image"
        />
      </NuxtLink>
      <div class="product-card-actions">
        <button class="add-to-wishlist">
          <i class="fas fa-heart"></i>
        </button>
        <button class="add-to-compare">
          <i class="fas fa-random"></i>
        </button>
      </div>
    </div>

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

It looks like the item.data is not available at the first rendering, You should add a conditional rendering in your img element :

<img v-if="item.data" :src="http://marketplus.io/${item.data.upload[0].link}" />
about 4 years ago · Santiago Trujillo 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!