#Problem in Promptopia.
20 messages · Page 1 of 1 (latest)
- Expectations! What did you expect your code to do? What did it actually do?
- Errors! If your code produced an error, paste the error message for us to see!
- Code! We can't help you if you don't show us the code that you're having trouble with. No screenshots -- use code blocks instead please (!!help.codeblocks).
- Libraries! If you're using a library, tell us the library name.
This problem
Can you share what post is? console.log(JSON.stringify(post))
In general
!!js.undefined
Uncaught TypeError: Cannot read properties of undefined (reading 'name') (or a very similar message)
This means you have tried to access a property on a value that is undefined. A value could be undefined (or null) for many reasons.
// Using a variable without declaring it:
foo.name;
// Declaring a variable, but not setting a value:
let foo;
foo.name;
// Declaring a variable, but setting it to undefined explicitly...
// or returning undefined from a function or method:
let foo = undefined;
foo.name
You'll have to find the variable on which you try to access the property, and work backwards to find out why it's undefined (or null). Errors come with stack traces right underneath. It will say the exact line and position where the error occurred.
Got solution for this I used {[myPosts]} instead of {myPosts}
Everything works fine now on Local machine but now having some problem on Deployment
I managed the deploy but on Vercel my feed is not updating after deployment
Only when I redeploy it my feed get updated otherwise adding new prompt or deleting existing prompt is not showing on my feed
On Local machine I am able to see instant feed update but not on Vercel
Where did you use {[myPosts]} ?
App-profile-page.jsx
Thanks man
Your problem solved too?
Yeah, it did. Thanks bro
hey just wondering the delete prompts seems not working correctly after I hit refresh, all prompts popped back up.. I think something has to do with this line of code?
if (hasConfirmed) {
try {
await fetch(`/api/prompt/${post._id.toString()}`, {
method: "DELETE",
});