Open cmsbased opened 3 years ago
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
Hi,
I'm facing the same issue.
Does anyone have any advice / solution to resolve this problem?
Thanks in advance.
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.
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.
Steps to replicate:
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 inImage
, but its value isundefined
."