Gatsby image crashes with unhelpful message if not passed any parameters #25370
Labels
topic: media
Related to gatsby-plugin-image, or general image/media processing topics
type: bug
An issue or pull request relating to a bug in Gatsby
Description
Including a Gatsby image on a page without any parameters, like so
<Img />
, crashes the page at runtime with the error messageTypeError: Cannot read property '0' of undefined
.I came across this in a Stackoverflow question
Steps to reproduce
Create a new site using
gatsby new site
, change<Img fluid={data.placeholderImage.childImageSharp.fluid} />
insrc/components/image.js
to<Img/>
Expected result
I'd expect the image not to render and possibly an error to be printed on the console.
Actual result
Page crashes as per above.
Environment
(Gatsby version corresponds to
master
built from source)The text was updated successfully, but these errors were encountered: