profile
viewpoint

Ask questionsgatsby-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(R) Core(TM) 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

gatsbyjs/gatsby

Answer questions OllieJT

Additional tests.

  • deployed shopify-starter and built successfully with demo data
  • changed gatsby-source-shopify2 to gatsby-source-shopify and reinstalled all node_modules
  • built successfully with demo data
  • cleared gatsby cache and changed .env credentials to the desired store
  • ERROR (see below)
success open and validate gatsby-configs — 0.008 s
success load plugins — 0.210 s
success onPreInit — 0.586 s
success initialize cache — 0.005 s
success copy gatsby files — 0.070 s
success onPreBootstrap — 0.005 s
⠁ 
gatsby-source-shopify/undefined starting to fetch data from Shopify
⢀ source and transform nodes
error an error occured while sourcing data
query: 
  """
    
      query GetCollections($first: Int!, $after: String) {
        shop {
          collections(first: $first, after: $after) {
            pageInfo {
              hasNextPage
            }
            edges {
              cursor
              node {
                description
                descriptionHtml
                handle
                id
                image {
                  altText
                  id
                  src
                }
                products(first: 250) {
                  edges {
                    node {
                      id
                    }
                  }
                }
                title
                updatedAt
              }
            }
          }
        }
      }
    
  """
variables: 
  first: 250
  after: null
success source and transform nodes — 0.844 s
success building schema — 0.169 s
error gatsby-node.js returned an error


  TypeError: Cannot read property 'allShopifyProduct' of undefined
  
  - gatsby-node.js:16 graphql.then.result
    /Users/olliejt/Documents/GitHub/gatsby-shopify-starter/gatsby-node.js:16:17
  

success createPages — 0.058 s
success createPagesStatefully — 0.065 s
success onPreExtractQueries — 0.006 s
success update schema — 0.028 s
error GraphQL Error Encountered 2 error(s):
- Unknown field 'allShopifyProduct' on type 'Query'. Source: document `usersOlliejtDocumentsGitHubGatsbyShopifyStarterSrcComponentsProductGridIndexJs3449166288` file: `GraphQL request`
  
  GraphQL request (3:9)
  2:       query {
  3:         allShopifyProduct(
             ^
  4:           sort: {
  
- Unknown field 'shopifyProduct' on type 'Query'. 

      file: /Users/olliejt/Documents/GitHub/gatsby-shopify-starter/src/templates/ProductPage/index.js



success extract queries from components — 0.139 s
⠁ (node:88029) DeprecationWarning: Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.
error 
The GraphQL query from /Users/olliejt/Documents/GitHub/gatsby-shopify-starter/src/components/ProductGrid/index.js failed.

Errors:
  Cannot query field "allShopifyProduct" on type "Query".
  
  GraphQL request (2:3)
  1: query usersOlliejtDocumentsGitHubGatsbyShopifyStarterSrcComponentsProductGridIndexJs3449166288 {
  2:   allShopifyProduct(sort: {fields: [createdAt], order: DESC}) {
       ^
  3:     edges {
  
Plugin:
  none
Query:
  query usersOlliejtDocumentsGitHubGatsbyShopifyStarterSrcComponentsProductGridIndexJs3449166288 {
    allShopifyProduct(sort: {fields: [createdAt], order: DESC}) {
      edges {
        node {
          id
          title
          handle
          createdAt
          images {
            id
            originalSrc
            localFile {
              childImageSharp {
                fluid(maxWidth: 910) {
                  ...GatsbyImageSharpFluid_withWebp_tracedSVG
                }
              }
            }
          }
          variants {
            price
          }
        }
      }
    }
  }
  
  fragment GatsbyImageSharpFluid_withWebp_tracedSVG on ImageSharpFluid {
    tracedSVG
    aspectRatio
    src
    srcSet
    srcWebp
    srcSetWebp
    sizes
  }
  
success run graphql queries — 0.089 s — 9/9 101.58 queries/second
success write out page data — 0.008 s
success write out redirect data — 0.001 s
success onPostBootstrap — 0.119 s

info bootstrap finished - 9.278 s

 ERROR  Failed to compile with 1 errors                                                                                                                            2:37:10 AM

 error  in ./src/components/ProductGrid/index.js

Module Error (from ./node_modules/eslint-loader/index.js):

/Users/olliejt/Documents/GitHub/gatsby-shopify-starter/src/components/ProductGrid/index.js
  11:9  error  Cannot query field "allShopifyProduct" on type "Query"  graphql/template-strings

✖ 1 problem (1 error, 0 warnings)


 @ ./src/pages/index.js 9:0-52 15:163-174
 @ ./.cache/sync-requires.js
 @ ./.cache/app.js
 @ multi event-source-polyfill (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false ./.cache/app

✖ 「wdm」: 
ERROR in ./src/components/ProductGrid/index.js
Module Error (from ./node_modules/eslint-loader/index.js):

/Users/olliejt/Documents/GitHub/gatsby-shopify-starter/src/components/ProductGrid/index.js
  11:9  error  Cannot query field "allShopifyProduct" on type "Query"  graphql/template-strings

✖ 1 problem (1 error, 0 warnings)

 @ ./src/pages/index.js 9:0-52 15:163-174
 @ ./.cache/sync-requires.js
 @ ./.cache/app.js
 @ multi event-source-polyfill (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false ./.cache/app
ℹ 「wdm」: Failed to compile.
useful!

Related questions

Error: Cannot create as TypeComposer the following value: Date. hot 3
Importing Link from gatsby breaks Storybook hot 2
Loading chunks while a new release is deployed hot 2
Webpack error #98123 when running "gatsby develop" hot 2
gatsby build error #11328 A page component must export a React component for it to be valid. Please make sure this file exports a React component: /Users/tiagosanchez/Documents/Projects/personalBlog/node_modules/gatsby-plugin-offline/app-shell.js hot 2
[gatsby-telemetry] error: src/postinstall.js not found in Linux environments hot 2
IE11: Object not valid as React Child hot 2
CircleCI build Error: spawn ENOMEM hot 2
[Help] I somehow managed to butcher my site's performance hot 2
Build gets stuck at Generating image thumbnails / Update schema on large sites hot 2
[gatsby-source-graphql] Shopify GraphQL Schema Error hot 2
UNHANDLED REJECTION Source and destination must not be the same. hot 2
Gatsby's Use Of Polyfills and the 'Missing Resources for x' error hot 2
Autoprefixer "browsers" option is deprecated in v9, produces warnings hot 2
'gatsby' is not recognized as an internal or external command hot 2
Github User Rank List