I'm working on a small project using VueJS / Axios. I'm getting an error in my console log :
Error in render: "TypeError: Cannot read property 'first_name' of undefined"
Since I'm getting and showing the first_name correctly ( i see the result in my page ) the problem just in the console
this is my code :
export default {
data(){
return {
collection:{
data: []
}
}
},
created: function(){
getAPI.get('/api/contacts/1/', [{'x':'10'}]).then((response) => {
this.collection.data = response.data
})
}
}
HTML code :
<span class="d-block info-content">
{{collection.data.contactInfos.first_name}}
</span>
By the way i see the result i see the name, in my HTML, but just i'm wondering about my console log error since the code work perfectly