strapi/nextjs-corporate-starter

Images for navbarLogo, footerLogo & testimonials are not set by default, causing the frontend not to load

LunatikDev opened this issue · 2 comments

I don't know if this issue occured because i upgraded to the latest Strapi version (v4.20.4) but even if data import works fine when we load the frontend app we are hit by several errors:

image

So i managed to fix that one by going to Content Manager / Single Types / Global and manually configuring the images for navbarLogo & footerLogo

Then i try to reload the page again and i am hit by another error:

image

I strugled a bit to find where to set those images so here is how to fix it:

the error displayed when loading the home page so i've gone to Content Manager / Collection Types / Page / Home Page and i manually set the image for each of the testimonials (Paul Brats & Kit Kat)

I recommend you update your template to latest version and fix those issues.

Just my two cent:

I think it may be a good idea if an image is not found (problems do happens) to skip the image or display a replacement image (ex: imagenotfound image) so the content can load normally. Right now if a problem happens with an image our page will just breaks and the end-user cannot enjoy our great content (that sucks). Take Wordpress for example, images do break sometimes (more often that we may want) but the content will still be loaded..

Aditionnally, if a problem with an image happens it will be a good idea to send a notification to the author so that issue is fixed ASAP

PS: i'm new to Next.js, i will try on my own to implement those features and if by any chance i manage to do it before you guys i will create a pull request to share the fix with the community 😉

Thanks for making this template by the way, this greatly helps me understand how to work with Strapi in Next.js!

@LunatikDev thank you for the feedback. I am planning to revisit this and update the project to the current version of Strapi. This is on my list of things to do.

@LunatikDev upon further investigation.

I don't know if this issue occurred because i upgraded to the latest Strapi version (v4.20.4) but even if data import works fine when we load the frontend app we are hit by several errors:

Yes, this is due to upgrading the version. There seems to be a bug with data import that is not importing the logoImage relations and also the categories in the global content type.

I will have to explore it further.

For now the fix is just to update those items manually.

update.mp4

I also updated the app from not crashing if those items are missing after import. #118

I ended up testing the PR and it now does not throw the errors that you ran into previously. Thanks again for your feedback.