lundi 13 novembre 2017

Laravel - VueJS Cannot read property 'username'

I'm following the forum tutorial from Laracasts, and I'm currently in episode 36. I followed the tutorial from 0:00 till 7:20, and at that moment there is a brief second where he switches to the page to see the replies. The problem is, I don't see my replies at all. Instead, I get an error in the console, The error is stating:

[Vue warn]: Error in render: "TypeError: Cannot read property 'username' of undefined"

found in

---> <Reply> at resources\assets\js\components\Reply.vue
   <Replies> at resources\assets\js\components\Replies.vue
     <PostView> at resources\assets\js\pages\Post.vue 

I don't know what is causing this, and I have been stuck with this problem for more than a day now. I did some digging to look if I even had the owner method in my Reply model and I do. So why can't it fetch the reply's owner's username?

For the sake of keeping this question short, I've created some Pastebin links to the files that are maybe causing the problem

Reply.vue: http://ift.tt/2ADCteZ

Post.vue: http://ift.tt/2i9VtuQ

Replies.vue: http://ift.tt/2AALSE2

Thanks in advance



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2iax5Jp
via IFTTT

Aucun commentaire:

Enregistrer un commentaire