gatsby: gatsby-source-shopify unable to complete build

Description

I have been unable to complete the build process using the ‘gatsby-source-shopify’ plugin. The progress varies each time, but it always stalls on “source and transform nodes” after a successful “fetched and processed collections”

Steps to reproduce

I have tried

  • disabling all plugins just to get through a build
  • using a fresh install with gatsby-starter
  • using the shopify-starter (a forked version of gatsby-shopify) which works with the demo content, but not with my own store credentials.

I am beginning to believe it is something to do with the store I am pulling from. The store is a live site with ~550 products and so I am apprehensions about posting any keys.

Expected result

  • gatsby develop
  • gatsby-source-shopify sources and transforms nodes
  • build completes and is in development mode

Actual result

  • gatsby develop
  • gatsby-source-shopify begins to source and transforms nodes but freezes
vbi-store $  gatsby develop

success open and validate gatsby-configs — 0.025 s
success load plugins — 0.212 s
success onPreInit — 1.370 s
success initialize cache — 0.199 s
success copy gatsby files — 0.062 s
success onPreBootstrap — 0.895 s
gatsby-source-shopify/visuals-by-impulse starting to fetch data from Shopify
 source and transform nodes
gatsby-source-shopify/visuals-by-impulse fetched and processed productTypes: 551.321ms
gatsby-source-shopify/visuals-by-impulse fetched and processed policies: 570.847ms
Downloading remote files [==============================] 21/21 1.0 secs 100%
gatsby-source-shopify/visuals-by-impulse fetched and processed collections: 2024.666ms
source and transform nodesFailed to process remote content https://cdn.shopify.com/s/files/1/1353/2527/products/stream-panels-colored-twitch-panels-1.png
source and transform nodesFailed to process remote content https://cdn.shopify.com/s/files/1/1353/2527/products/stream-panels-colored-twitch-panels-6.png
source and transform nodesFailed to process remote content https://cdn.shopify.com/s/files/1/1353/2527/products/Logo_Presentation_62426fbf-eed8-4710-92b8-443e8cca67d3.png
source and transform nodesFailed to process remote content https://cdn.shopify.com/s/files/1/1353/2527/products/16x9-Green_b9f770a0-1409-4b2b-885c-cd31c37a155d.png
source and transform nodesFailed to process remote content https://cdn.shopify.com/s/files/1/1353/2527/products/16x9-Teal_5c4ae163-68be-4670-8106-69eeefffdedf.png

source and transform nodes

Failed to process remote content varies from 0-10 items

Environment

System: OS: macOS 10.14.3 CPU: (8) x64 Intel® Core™ i7-7920HQ CPU @ 3.10GHz Shell: 3.2.57 - /bin/bash Binaries: Node: 10.15.3 - /usr/local/bin/node Yarn: 1.10.1 - /usr/local/bin/yarn npm: 6.9.0 - /usr/local/bin/npm Languages: Python: 2.7.10 - /usr/bin/python Browsers: Chrome: 73.0.3683.86 Safari: 12.0.3 npmPackages: gatsby: ^2.3.4 => 2.3.4 gatsby-image: ^2.0.35 => 2.0.35 gatsby-plugin-manifest: ^2.0.26 => 2.0.26 gatsby-plugin-offline: ^2.0.25 => 2.0.25 gatsby-plugin-prefetch-google-fonts: ^1.4.1 => 1.4.1 gatsby-plugin-prismic-preview: ^2.0.0 => 2.0.0 gatsby-plugin-react-helmet: ^3.0.11 => 3.0.11 gatsby-plugin-sharp: ^2.0.32 => 2.0.32 gatsby-plugin-styled-components: ^3.0.7 => 3.0.7 gatsby-remark-prettier: ^1.0.0 => 1.0.0 gatsby-source-custom-api: ^0.1.1 => 0.1.1 gatsby-source-filesystem: ^2.0.28 => 2.0.28 gatsby-source-graphql: ^2.0.15 => 2.0.15 gatsby-source-prismic-graphql: ^3.0.2 => 3.0.2 gatsby-source-prismic-rich-text-fields: ^1.0.0 => 1.0.0 gatsby-source-shopify-min: github:olliejt/gatsby-source-shopify-min#master => 2.0.24 gatsby-transformer-remark: ^2.3.8 => 2.3.8 gatsby-transformer-sharp: ^2.1.17 => 2.1.17 npmGlobalPackages: gatsby-cli: 2.4.14

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (4 by maintainers)

Most upvoted comments

Hi everyone. I was getting similar error messages (error an error occurred while sourcing data) and found this issue.

The issue in my case was the value I was using for the accessToken when setting up gatsby-source-shopify in gatsby-config.

I had overlooked that the accessToken is the Storefront access token, not you Shopify private app’s API Key.

It would be great if you got a more specific error message when this is the case (that the credentials are invalid).

@perryraskin faced the same issue, struggled about an hour with that till accidentally found that products were not available on the private app that was created to obtain the access token and play around with storefront API - you know, the section where you can manage items availability on sales channels and apps.

i followed this tutorial exactly and i’m getting this error:

AggregateError: GraphQLDocumentError: Cannot query field "allShopifyProduct" on type "Query". Did you mean "allShopifyShopPolicy" or "allShopifyCollection"?
      GraphQLDocumentError: Cannot query field "allShopifyProduct" on type "Query". Did you mean "allShopifyShopPolicy" or "allShopifyCollection"?
      GraphQLDocumentError: Cannot query field "allShopifyProduct" on type "Query". Did you mean "allShopifyShopPolicy" or "allShopifyCollection"?
      GraphQLDocumentError: Cannot query field "allShopifyProduct" on type "Query". Did you mean "allShopifyShopPolicy" or "allShopifyCollection"?
      GraphQLDocumentError: Cannot query field "allShopifyProduct" on type "Query". Did you mean "allShopifyShopPolicy" or "allShopifyCollection"?
      GraphQLDocumentError: Cannot query field "allHomemoderns" on type "PRISMIC". Did you mean "allCommons", "allHomes", or "allCategorys"?
      GraphQLDocumentError: Cannot query field "allHomeminimals" on type "PRISMIC". Did you mean "allCommons" or "allHomes"?
      GraphQLDocumentError: Cannot query field "products" on type "ShopifyCollection".
      GraphQLDocumentError: Cannot query field "products" on type "ShopifyCollection".
      GraphQLDocumentError: Cannot query field "shopifyProduct" on type "Query". Did you mean "shopifyShopPolicy", "shopifyCollection", or "allShopifyShopPolicy"?
      GraphQLDocumentError: Unknown argument "products" on field "shopifyCollection" of type "Query".
      GraphQLDocumentError: Cannot query field "products" on type "ShopifyCollection".
      GraphQLDocumentError: Cannot query field "allHomeminimals" on type "PRISMIC". Did you mean "allCommons" or "allHomes"?
      GraphQLDocumentError: Cannot query field "products" on type "ShopifyCollection".

In addition to other similar ones like:

ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown argument "products" on field "shopifyCollection" of type "Query".

GraphQL request:32:21
31 |            }
32 |            shopifyCollection(products: { elemMatch: { handle: { eq: $handle } } }) {
   |                     ^
33 |                    products {

File: src/templates/product-page.tsx:251:21

Any help really appreciated!

The issue could be that your store simply has 0 products.

Try adding a dummy product and see if that solves it…

I had the same problem as the OP and @AllanPooley’s comment solved it.

Additionally, you need to make products available to the private app’s storefront or else you get a similar error.