Skip to content

Error even with source code for lecture 78 (previous lecture Nr52 ? )  #3

@TheLaughingThird

Description

@TheLaughingThird

Hello,

There seems to be a problem with the 52-end.zip source code package. In lesson 78 I cant get the author name to be dynamic and my app keeps crashing. Link to course: https://www.udemy.com/course/learn-javascript-full-stack-from-scratch/learn/lecture/15187916

When you try to visit a post you do have created like this example.

http://localhost:3000/post/63737db924dc689ee19085eb
When you run it , it throws a error.

I was comparing my code with the source code because I thought I made a typo, but this error also shows up when running your source code

The error

/var/www/html/52/models/Post.js:67
username: post.author.username,
TypeError: Cannot read properties of undefined (reading 'username')
at /var/www/html/52/models/Post.js:67:31
at Array.map ()
at /var/www/html/52/models/Post.js:65:19
at processTicksAndRejections (node:internal/process/task_queues:96:5)

Enclosure
52-end.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions