2

I recently switched from react static to gatsby & hit a wall. When I install & build gatsby-starter-netlify-cms I get an error:

success open and validate gatsby-configs — 0.049 s
success load plugins — 1.757 s
success onPreInit — 53.736 s
success delete html and css files from previous builds — 0.013 ssuccess initialize cache — 0.725 s
success copy gatsby files — 4.323 s
success onPreBootstrap — 0.261 s
success source and transform nodes — 1.672 s
success building schema — 6.302 s
success createPages — 0.634 s
success createPagesStatefully — 0.525 s
success onPreExtractQueries — 0.211 s
success update schema — 1.565 s
error GraphQL Error Field "image" must not have a selection since type "String" has no subfields.

  file: C:/Users/Jason/Dropbox/Documents/Projects/jamamuuga-s-portfolio-gatsby-netlifycms/src/templates/product-page.js

   1 |
   2 |   query ProductPage($id: String!) {
   3 |     markdownRemark(id: { eq: $id }) {
   4 |       frontmatter {
   5 |         title
>  6 |         image {
     |               ^
   7 |           childImageSharp {
   8 |             fluid(maxWidth: 2048, quality: 100) {
   9 |               ...GatsbyImageSharpFluid
  10 |             }
  11 |           }
  12 |         }
  13 |         heading
  14 |         description
  15 |         intro {
  16 |           blurbs {

  error Command failed with exit code 1.

I tried with both yarn & npm seperately to no avail.

Jela Miraj
  • 31
  • 3
  • Check this; https://github.com/gatsbyjs/gatsby/issues/4123 – Habil Nov 15 '18 at 14:35
  • Thanks, I wish I could fix it myself, maybe following @pieh's suggestion. Since I am not familiar enough with the code base to fix it just yet, I went and filed an issue: https://github.com/netlify-templates/gatsby-starter-netlify-cms/issues/133. – Jela Miraj Nov 15 '18 at 21:11
  • @Jamamuuga what solved this for you? – Kyle Pennell Apr 17 '19 at 18:47
  • 1
    @KylePennell I don't remember what exactly fixed it. My best guess is that later commits started working with updated packages, meaning the problem just magically disappeared in time... – Jela Miraj May 30 '19 at 22:50

1 Answers1

0

You should check your markdown files and find files which have empty values for the field image, or values that point to non existing image. Frontmatter of a markdown file referes to the top of the file which containes some metadata of the file and is surrounded with ---. For example:

---

image:

//my coment: list of some other variables follow, like heading, title....

---

Saša Šijak
  • 8,717
  • 5
  • 47
  • 82