Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

Warning: Failed prop type: The prop media is marked as required in Image, but its value is undefined. #55

Open
cmsbased opened this issue Aug 9, 2021 · 4 comments

Comments

@cmsbased
Copy link

cmsbased commented Aug 9, 2021

Steps to replicate:

  1. yarn create strapi-starter my-site next-corporate
  2. Open http://localhost:3000/ and check Chrome browser dev console.

Shows prop type error right from the very start.

"react-jsx-dev-runtime.development.js:117 Warning: Failed prop type: The prop media is marked as required in Image, but its value is undefined."

@abraham-yusuf
Copy link

Warning: Failed prop type: The prop media is marked as required in Image, but its value is undefined.
same the problem, i think need little configure in next.config.js but not work

@DominiqueBertrand
Copy link

Hi,

I'm facing the same issue.

Does anyone have any advice / solution to resolve this problem?

Thanks in advance.

@pipozoft
Copy link

pipozoft commented Oct 18, 2021

Under this file starter/components/elements/image.js, you can make the media attribute of Image not required by changing line 34 from:

Image.propTypes = {
  media: mediaPropTypes.isRequired,
  className: PropTypes.string,
}

to

Image.propTypes = {
  media: mediaPropTypes,
  className: PropTypes.string,
}

That solved the issue for me. Hope it helps.

@lKrayola
Copy link

lKrayola commented Dec 9, 2021

I was testing a clean install of this starter on my WSL Ubuntu yesterday and it worked perfectly.

Today I generated another clean install and for some reason I got this same error

Warning: Failed prop type: The prop media is marked as required in Image, but its value is undefined."

logos and images not rendering correctly. On top of that, @pipozoft 's workaround did not solved the issue for me.

Then I decided to generate it again on my manjaro laptop and it now renders all the images perfectly but it gives me this error instead.

TypeError: Cannot destructure property 'attributes' of 'strapi.getModel(...)' as it is undefined.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants