ed-roh / mern-social-media

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

Home Page disappears upon login #26

Open stiltz46 opened 1 year ago

stiltz46 commented 1 year ago

Not sure why, but after I login I see the Home Page for about 1/2 a second, then the webpage goes blank. I've never been able to see the homepage for more than 1/2 a second. Getting a 304 error. I tried clearing my cache, flushing DNS and running security scans. Nothing helps.

image
JustHarsh commented 1 year ago

I had a similar issue.

In index.js in your Navbar folder, replace const fullName = `${user.firstName} ${user.lastName}`; with

const fullName = user ? `${user.firstName} ${user.lastName}` : "";

It happens because your backend isn't running. So, it doesn't know what user is.

RPasquale commented 1 year ago

I made the above change and my error changed to this :

Uncaught TypeError: Cannot read properties of undefined (reading '63ed70a168cae755d301f8f0')

AboubakerIdHamide commented 1 year ago

If it's the error of find() is not afunction , you just need to destruct the friends from the redux state in Friends.jsx file const { friends } = useSelector((state) => state.user.friends);