Closed shuzel99 closed 2 years ago
so, try to console log the user(props.user) in the profile component and share what the console log says
Console.log from the profile component coming back null and I dont know why. I'm going to consolidate profile & users on the backend, have users fill out profile info on sign up so there's no prop to pass
What's the update on this?
resolved. I went back and did some postman investigating
What stack are you using?
(ex: MERN(mongoose + react), DR(django + react), PEN, etc.)
MERN
What's the problem you're trying to solve?
on log in, users have an email, password, and id. When I go to the /profile route it says it cant read ._id even though it's passed down as a prop.
Post any code you think might be relevant (one fenced block per file)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
In the backend I see this "BSONTypeError: Argument passed in must be a string of 12 bytes or a string of 24 hex characters" and the ._id is "61de89692e9a6af8ade3bf6f". In the frontend I see "unable to read ._id"
What is your best guess as to the source of the problem?
The app is bad luck.
What things have you already tried to solve the problem?
I've tried console logging at different points in promises in app.js and on login ._id is grabbed just fine. When I try to hit the profile route is when things get weird