ed-roh / mern-social-media

Complete React MERN Full Stack Social Media App
992 stars 859 forks source link

typeError: Cannot read properties of undefined (reading '63b163ddf70362f01606270c') #14

Open yadvendra2998 opened 1 year ago

yadvendra2998 commented 1 year ago

this error generated from this line of code const isLiked = Boolean(likes[loggedInUserId]);

khrisdain commented 1 year ago

were you able to fix it

rutujp78 commented 1 year ago

Getting same error. Any fix?

Preet1810 commented 1 year ago

in your home page change <PostWidget userId={_id} /> to <PostsWidget userId={_id} />

rutujp78 commented 1 year ago

<PostsWidget userId={_id} /> is there in index.jsx of HomePage. I am getting this error while opening profile page of other people as well as mine.

Preet1810 commented 1 year ago

try clearing cache, still if it did not worked post code i will try to debug

rutujp78 commented 1 year ago

@Preet1810 Repo Link: https://github.com/rutujp78/SocioPedia

PatrickEinstein commented 1 year ago

i got this error when i tried converting posts to array on Posts widget since console kept yelling posts.map is not a function