Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gatsby-source-contentful returns empty srcSet and srcSetWebp when querying fixed images with only height argument. #24392

Closed
mrseanbaines opened this issue May 23, 2020 · 0 comments · Fixed by #25776
Assignees
Labels
topic: source-contentful Related to Gatsby's integration with Contentful type: bug An issue or pull request relating to a bug in Gatsby

Comments

@mrseanbaines
Copy link
Contributor

Description

gatsby-source-contentful returns empty srcSet and srcSetWebp when querying fixed images with only height argument.

These values are included when making the same query but passing in a width argument, and also included when passing a height argument if using gatsby-plugin-sharp. See screenshot for comparison:

image

Steps to reproduce

  1. Create new Gatsby project from default starter
  2. Install and configure gatsby-source-contentful
  3. Upload gatsby-astronaut image to Contentful
  4. Edit the Image component query to this:
query {
  contentfulAsset(title: { eq: "gatsby-astronaut" }) {
    fixed(width: 500) {
      width
      height
      src
      srcSet
      srcWebp
      srcSetWebp
    }
  }
}

Expected result

A value for both srcSet and srcSetWebp should be returned.

Actual result

Empty strings are returned for both fields.

Environment


  System:
    OS: macOS 10.15.4
    CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.16.1 - /usr/local/bin/node
    Yarn: 1.22.4 - ~/.yarn/bin/yarn
    npm: 6.13.4 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 83.0.4103.61
    Firefox: 76.0.1
    Safari: 13.1
  npmPackages:
    gatsby: ^2.21.37 => 2.22.9 
    gatsby-image: ^2.4.4 => 2.4.4 
    gatsby-plugin-manifest: ^2.4.5 => 2.4.9 
    gatsby-plugin-offline: ^3.2.3 => 3.2.7 
    gatsby-plugin-react-helmet: ^3.3.1 => 3.3.1 
    gatsby-plugin-sharp: ^2.6.4 => 2.6.9 
    gatsby-source-contentful: ^2.3.12 => 2.3.12 
    gatsby-source-filesystem: ^2.3.4 => 2.3.8 
    gatsby-transformer-sharp: ^2.5.2 => 2.5.2 
@mrseanbaines mrseanbaines added the type: bug An issue or pull request relating to a bug in Gatsby label May 23, 2020
@mrseanbaines mrseanbaines self-assigned this May 23, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 23, 2020
@mrseanbaines mrseanbaines added status: community assigned topic: source-contentful Related to Gatsby's integration with Contentful and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: source-contentful Related to Gatsby's integration with Contentful type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
1 participant