question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cover images returning null inconsistently from Docs

See original GitHub issue

The npmPackages:

gatsby: ^2.20.14 => 2.20.14
    gatsby-cli: ^2.11.5 => 2.11.5
    gatsby-image: ^2.3.2 => 2.3.2
    gatsby-plugin-catch-links: ^2.2.1 => 2.2.1
    gatsby-plugin-manifest: ^2.3.3 => 2.3.3
    gatsby-plugin-offline: ^3.1.2 => 3.1.2
    gatsby-plugin-prefetch-google-fonts: ^1.4.3 => 1.4.3
    gatsby-plugin-react-helmet: ^3.2.1 => 3.2.1
    gatsby-plugin-sharp: ^2.5.4 => 2.5.4
    gatsby-plugin-styled-components: ^3.2.1 => 3.2.1
    gatsby-plugin-typography: ^2.4.1 => 2.4.1
    gatsby-remark-embed-video: ^2.0.1 => 2.0.1
    gatsby-remark-images: ^3.2.2 => 3.2.2
    gatsby-remark-responsive-iframe: ^2.3.1 => 2.3.1
    gatsby-source-filesystem: ^2.2.2 => 2.2.2
    gatsby-source-google-docs: ^2.0.0-beta.6 => 2.0.0-beta.6
    gatsby-transformer-remark: ^2.7.1 => 2.7.1
    gatsby-transformer-sharp: ^2.4.4 => 2.4.4

When gatsby develop is run the Docs in a folder, each have a header, ‘Different first page’ is checked, all have an image, in a query not all images are returned:

"cover": {
                "image": null
              }

If I edit one of the Docs that has returned null for the image and then run develop that Doc may now return the data for the image, though now other Docs that returned an image before may now show in the query as null. I cannot see that there is any pattern to this behaviour. Only that a change to what returns either, the image data, or a null, changes only if there’s been an edit or an addition of a new Doc. Running gatsby develop builds the same number of complete images each time it’s run. I have also run gatsby clean - this does not alter this behavior.

Example in GraphiQL: for the public Google folder

query MyQuery {
  allMarkdownRemark(filter: {frontmatter: {page: {eq: "news"}}}, sort: {fields: frontmatter___year, order: DESC}, limit: 10) {
    edges {
      node {
        frontmatter {
          name
          cover {
            image {
              childImageSharp {
                fluid(maxWidth: 300) {
                  src
                }
              }
            }
          }
        }
      }
    }
  }
}

Returns: (these should all return the image)

{
  "data": {
    "allMarkdownRemark": {
      "edges": [
        {
          "node": {
            "frontmatter": {
              "name": "Tony Luciani's \"The Dressmaker\" awarded 1st prize in the 10th International \"FIGURATIVAS 2019\" Painting & Sculpture Competition",
              "cover": {
                "image": null
              }
            }
          }
        },
        {
          "node": {
            "frontmatter": {
              "name": "Dr. Roberta Bondar Celebrates 27th Anniversary of Space Launch",
              "cover": {
                "image": {
                  "childImageSharp": {
                    "fluid": {
                      "src": "/static/96369c2d10bd5db831e4e649bbe18067/35801/google-docs-image-0d6acd37-3643-5107-9f42-0d6a82070b96.jpg"
                    }
                  }
                }
              }
            }
          }
        },
        {
          "node": {
            "frontmatter": {
              "name": "Tony Luciani \"Inside My Head\" on CBC Radio",
              "cover": {
                "image": null
              }
            }
          }
        },
        {
          "node": {
            "frontmatter": {
              "name": "W. David Ward \"Eyes of Society: Art, Traditional Knowledge, and the Watchmen of Haida Gwaii\"",
              "cover": {
                "image": null
              }
            }
          }
        },
        {
          "node": {
            "frontmatter": {
              "name": "Shannon Craig Morphew: Featured in the Dulwich Picture Gallery's \"In View\" magazine",
              "cover": {
                "image": {
                  "childImageSharp": {
                    "fluid": {
                      "src": "/static/c49446a06709af5cb7f8690051fcdba3/9dc27/google-docs-image-84b6ba87-eb38-5a04-a9f1-b87710471aaf.jpg"
                    }
                  }
                }
              }
            }
          }
        },
        {
          "node": {
            "frontmatter": {
              "name": "The Art of the Deal",
              "cover": {
                "image": {
                  "childImageSharp": {
                    "fluid": {
                      "src": "/static/c48a9a2c19722a9a43e32c0db0569c84/f836f/google-docs-image-5f658c01-c856-564c-8019-637d9cec7a81.jpg"
                    }
                  }
                }
              }
            }
          }
        },
        {
          "node": {
            "frontmatter": {
              "name": "The Art of Salesmanship",
              "cover": {
                "image": {
                  "childImageSharp": {
                    "fluid": {
                      "src": "/static/383aa78c3dc0f0577654850811045a7b/f836f/google-docs-image-6998840a-0d40-5e3c-9959-6b2d10ab6d90.jpg"
                    }
                  }
                }
              }
            }
          }
        },
        {
          "node": {
            "frontmatter": {
              "name": "A rare painting by Paul Kane sets a new record for Canadian Art",
              "cover": {
                "image": null
              }
            }
          }
        }
      ]
    }
  }
}

Thank you

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cedricdelpouxcommented, Apr 16, 2020

I will try to investigate this in the following weeks. For now, I can’t reproduce the issue. I will try with more covers

0reactions
cedricdelpouxcommented, May 7, 2020

Fixed in 2.0.0-beta.9

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Non resolvable built-in images variables return null ...
When using a built-in images variable that is non-resolvable, null is returned instead of an empty string, resulting in the following log ...
Read more >
Why does Image.IO.read() return null in this case?
It looks like it has to do with your image path. When you expand the variable, the value is ./res/Images. but from your...
Read more >
JaCoCo Maven plugin reports code coverage inconsistently ...
When I add log statements to check if the method is executed to the end, I can see the log statements in the...
Read more >
Accessing Files - Directus Docs
cover — Covers both width/height by cropping/clipping to fit; contain — Contain ... If the file is a(n) image/video, it's the width in...
Read more >
Element.setAttribute() - Web APIs | MDN
Sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found