-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read properties of undefined (reading 'image' in components/promptcard.jsx #62
Comments
@rana002 Getting the same error, have you found any solution? |
@rana002 @yeshwantthota problem is that the server renders the image before it is able to fetch |
@MihailoMilic bro can you send me full source code of this Promptopia website |
@Niti9 just change post.creator.image to post.creator?.image |
@MihailoMilic console shows the required attribute 'src' missing. |
Have anyone fixed this issue? |
Same issue |
Same issue. Optional chaining not fixing the issue. I think it has to do with the "populate" method in the GET posts end-point [ [EDIT] The problem was how I was accessing the userId from the session in my createPrompt function. In my post request, I was sending Everything working fine for me now. Hope this helps. |
this error comes when you use cluster url for the mongo and not on the local mongo url |
I deleted everything in my database and now it's fine. |
Fixed the issue with the following steps:
This is because In Next.js Version 14, domains configuration has been deprecated in favour of remotePatterns.
|
You are God bro ❤️
… On 11-Mar-2024, at 11:22, Alvaro Manterola ***@***.***> wrote:
Fixed the issue with the following steps:
Change the content of "images" on the next.config.mjs file with the following code:
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'lh3.googleusercontent.com',
port: '',
pathname: '/**',
},
],
This is because In Next.js Version 14, domains configuration has been deprecated in favour of remotePatterns.
Use the optional chaining in create-prompt/page.jsx: post.creator?.image
Clear the database and it will work perfectly.
—
Reply to this email directly, view it on GitHub <#62 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BA34AXJZA553E4NG2KTMDV3YXVBDFAVCNFSM6AAAAAA33QJ5MOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXGY3TSNZUG4>.
You are receiving this because you commented.
|
error TypeError: Cannot read properties of undefined (reading 'image')
at PromptCard (./components/PromptCard.jsx:46:51)
35 | >
36 | <Image
The text was updated successfully, but these errors were encountered: