2 years ago

Laravel - VueJS Cannot read property 'username'

Posted 2 years ago by Rainieren

Hello, I'm following Jeffreys forum tutorial, 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: https://pastebin.com/sGNgkgy3 Post.vue: https://pastebin.com/H9sjcZij Replies.vue: https://pastebin.com/LiKUapyn

Thanks in advance

Please sign in or create an account to participate in this conversation.