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

229
Views
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'address')

I am getting an error on my component. Can someone help to solve this? I'm work in vue 3 version. Getting an error: "Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'address')" Does anyone have any insights? profile.vue

<template>
<div>
         <div class="col col-lg-12 col-xl-12" v-for="(_postData, index) in postData" v- 
         bind:key="index">

             <h1>{{ _postData.id.address }}</h1>

         </div>
</div>
</template>

script

data() {
    return {
      postData: {},
      postPagination: {
        filter_data: [],
        page_no: 1,
        limit: 5
      }
    }
  },
getPost() {
      try {
        CreatorService.getAllMedia(this.postPagination)
          .then((response) => {
            if (response.status === true) {
              this.postData = response.data
            }
          })
          .catch((error) => {
            this.isPostLoading = false
            this.errorLog(error)
          })
      } catch (e) {
        this.errorTryLog(e)
      }
    }

response

[
  {
    "id": 1,
    "name": "Leanne Graham",
    "username": "Bret",
    "email": "Sincere@april.biz",
    "address": {
      "street": "Kulas Light",
      "suite": "Apt. 556",
      "city": "Gwenborough",
      "zipcode": "92998-3874",
      "geo": {
        "lat": "-37.3159",
        "lng": "81.1496"
      }
    },
    "phone": "1-770-736-8031 x56442",
    "website": "hildegard.org",
    "company": {
      "name": "Romaguera-Crona",
      "catchPhrase": "Multi-layered client-server neural-net",
      "bs": "harness real-time e-markets"
    }
  }  
]

Error Image enter image description here

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

0

Instead of _postData.id.address try _postData.address.

Demo :

new Vue({
  el: '#app',
  data: {
    postData: [
      {
        "id": 1,
        "name": "Leanne Graham",
        "username": "Bret",
        "email": "Sincere@april.biz",
        "address": {
          "street": "Kulas Light",
          "suite": "Apt. 556",
          "city": "Gwenborough",
          "zipcode": "92998-3874",
          "geo": {
            "lat": "-37.3159",
            "lng": "81.1496"
          }
        },
        "phone": "1-770-736-8031 x56442",
        "website": "hildegard.org",
        "company": {
          "name": "Romaguera-Crona",
          "catchPhrase": "Multi-layered client-server neural-net",
          "bs": "harness real-time e-markets"
        }
      }  
    ]
  }
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
  <div v-for="(_postData, index) in postData" :key="index">
    <pre>{{ _postData.address }}</pre>
  </div>
</div>

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!