gatsby-source-shopify plugin isn't working

Created on 29 Dec 2018  ·  5Comments  ·  Source: gatsbyjs/gatsby

Description

Describe the issue that you're seeing.
I'm trying to get up and running with the gatsby-source-shopify plugin, but its giving me a couple of errors whenever I run gatsby develop

I get the following in my terminal:

success open and validate gatsby-configs — 0.007 s
success load plugins — 0.174 s
success onPreInit — 0.361 s
success delete html and css files from previous builds — 0.014 s
success initialize cache — 0.014 s
success copy gatsby files — 0.047 s
success onPreBootstrap — 0.004 s
⠁
gatsby-source-shopify/unbrandedsupply starting to fetch data from Shopify
⠈ source and transform nodes
gatsby-source-shopify/unbrandedsupply fetched and processed policies: 383.057ms

gatsby-source-shopify/unbrandedsupply fetched and processed blogs: 403.497ms

gatsby-source-shopify/unbrandedsupply fetched and processed collections: 404.138ms

gatsby-source-shopify/unbrandedsupply fetched and processed articles: 432.904ms
⠄ source and transform nodes
error an error occured while sourcing data
error Plugin gatsby-source-shopify returned an error


  Error: createNodeId must be a function, was undefined

  - create-remote-file-node.js:327 module.exports
    [unbranded]/[gatsby-source-filesystem]/create-remote-file-node.js:327:11

  - nodes.js:62
    [unbranded]/[gatsby-source-shopify]/nodes.js:62:77

  - Generator.next

  - util.js:16 tryCatcher
    [global]/[bluebird]/js/release/util.js:16:23

  - promise.js:512 Promise._settlePromiseFromHandler
    [global]/[bluebird]/js/release/promise.js:512:31

  - promise.js:569 Promise._settlePromise
    [global]/[bluebird]/js/release/promise.js:569:18

  - promise.js:614 Promise._settlePromise0
    [global]/[bluebird]/js/release/promise.js:614:10

  - promise.js:693 Promise._settlePromises
    [global]/[bluebird]/js/release/promise.js:693:18

  - async.js:133 Async._drainQueue
    [global]/[bluebird]/js/release/async.js:133:16

  - async.js:143 Async._drainQueues
    [global]/[bluebird]/js/release/async.js:143:10

  - async.js:17 Immediate.Async.drainQueues
    [global]/[bluebird]/js/release/async.js:17:14


success source and transform nodes — 0.716 s
error Cannot read property 'internal' of undefined


  TypeError: Cannot read property 'internal' of undefined

  - infer-graphql-type.js:225 _.uniqBy.v
    [unbranded]/[gatsby]/dist/schema/infer-graphql-type.js:225:44

  - lodash.js:4282 baseUniq
    [unbranded]/[lodash]/lodash.js:4282:35

  - lodash.js:8420 Function.uniqBy
    [unbranded]/[lodash]/lodash.js:8420:40

  - infer-graphql-type.js:225 inferFromFieldName
    [unbranded]/[gatsby]/dist/schema/infer-graphql-type.js:225:15

  - infer-graphql-type.js:359 _.each
    [unbranded]/[gatsby]/dist/schema/infer-graphql-type.js:359:23

  - lodash.js:4911
    [unbranded]/[lodash]/lodash.js:4911:15

  - lodash.js:2996 baseForOwn
    [unbranded]/[lodash]/lodash.js:2996:24

  - lodash.js:4880
    [unbranded]/[lodash]/lodash.js:4880:18

  - lodash.js:9344 Function.forEach
    [unbranded]/[lodash]/lodash.js:9344:14

  - infer-graphql-type.js:338 _inferObjectStructureFromNodes
    [unbranded]/[gatsby]/dist/schema/infer-graphql-type.js:338:5

  - infer-graphql-type.js:409 inferObjectStructureFromNodes
    [unbranded]/[gatsby]/dist/schema/infer-graphql-type.js:409:10

  - build-node-types.js:138 inferFields
    [unbranded]/[gatsby]/dist/schema/build-node-types.js:138:26

  - build-node-types.js:187 fields
    [unbranded]/[gatsby]/dist/schema/build-node-types.js:187:19

  - Array.forEach


error UNHANDLED REJECTION


  TypeError: Cannot read property 'internal' of undefined

  - infer-graphql-type.js:225 _.uniqBy.v
    [unbranded]/[gatsby]/dist/schema/infer-graphql-type.js:225:44

  - lodash.js:4282 baseUniq
    [unbranded]/[lodash]/lodash.js:4282:35

  - lodash.js:8420 Function.uniqBy
    [unbranded]/[lodash]/lodash.js:8420:40

  - infer-graphql-type.js:225 inferFromFieldName
    [unbranded]/[gatsby]/dist/schema/infer-graphql-type.js:225:15

  - infer-graphql-type.js:359 _.each
    [unbranded]/[gatsby]/dist/schema/infer-graphql-type.js:359:23

  - lodash.js:4911
    [unbranded]/[lodash]/lodash.js:4911:15

  - lodash.js:2996 baseForOwn
    [unbranded]/[lodash]/lodash.js:2996:24

  - lodash.js:4880
    [unbranded]/[lodash]/lodash.js:4880:18

  - lodash.js:9344 Function.forEach
    [unbranded]/[lodash]/lodash.js:9344:14

  - infer-graphql-type.js:338 _inferObjectStructureFromNodes
    [unbranded]/[gatsby]/dist/schema/infer-graphql-type.js:338:5

  - infer-graphql-type.js:409 inferObjectStructureFromNodes
    [unbranded]/[gatsby]/dist/schema/infer-graphql-type.js:409:10

  - build-node-types.js:138 inferFields
    [unbranded]/[gatsby]/dist/schema/build-node-types.js:138:26

  - build-node-types.js:187 fields
    [unbranded]/[gatsby]/dist/schema/build-node-types.js:187:19

  - Array.forEach

Steps to reproduce

This is on a fresh install of gatsby, so replicating would just be to install the gatsby starter, and install then, install the gatsby-source-shopify plugin, then add the following to the gatsby config file:

{
      resolve: `gatsby-source-shopify`,
      options: {
        shopName: `unbrandedsupply`,
        accessToken: `xxxx`, //redacted
      },
    },

and then run ``

Actual result

What happened.

Environment

System:
OS: macOS 10.14
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
Yarn: 1.9.4 - ~/.nvm/versions/node/v8.12.0/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
Languages:
Python: 2.7.10 - /usr/bin/python
Browsers:
Chrome: 71.0.3578.98
Firefox: 63.0.3
Safari: 12.0
npmPackages:
gatsby: ^2.0.76 => 2.0.76
gatsby-image: ^2.0.20 => 2.0.25
gatsby-plugin-manifest: ^2.0.9 => 2.0.12
gatsby-plugin-offline: ^2.0.16 => 2.0.20
gatsby-plugin-react-helmet: ^3.0.2 => 3.0.5
gatsby-plugin-sharp: ^2.0.14 => 2.0.16
gatsby-source-filesystem: ^2.0.8 => 2.0.12
gatsby-source-shopify: ^2.0.3 => 2.0.3
gatsby-transformer-sharp: ^2.1.8 => 2.1.9
npmGlobalPackages:
gatsby-cli: 2.4.8
gatsby: 2.0.77

awaiting author response

Most helpful comment

I tried running the gatsby-source-shopify2 plugin instead, and that seems to work.

All 5 comments

Thank you for opening this @adamrasheed

I just tried creating a new Shopify store and Gatsby site from the default starter. Adding the plugin and running both gatsby develop and gatsby build work fine.
screenshot 2018-12-31 19 30 06
Since this issue is likely specific to your store, can you please link to a minimal reproduction? You can share the repo with me privately if you like (so that it includes the access token)

I tried running the gatsby-source-shopify2 plugin instead, and that seems to work.

Also having this issue

gatsby-source-shopify/crunchyhomecreations starting to fetch data from Shopify
⢀ source and transform nodes
gatsby-source-shopify/crunchyhomecreations fetched and processed policies: 187.852ms

gatsby-source-shopify/crunchyhomecreations fetched and processed blogs: 203.223ms

gatsby-source-shopify/crunchyhomecreations fetched and processed articles: 229.023ms

gatsby-source-shopify/crunchyhomecreations fetched and processed collections: 244.714ms
⠂ source and transform nodes
error an error occured while sourcing data
error Plugin gatsby-source-shopify returned an error

Error: createNodeId must be a function, was undefined

  • create-remote-file-node.js:327 module.exports
    [crunchyhomecreations.com]/[gatsby-source-filesystem]/create-remote-file-node.js:327:11

  • nodes.js:62
    [crunchyhomecreations.com]/[gatsby-source-shopify]/nodes.js:62:77

  • Generator.next

  • util.js:16 tryCatcher
    [lib]/[gatsby-cli]/[bluebird]/js/release/util.js:16:23

  • promise.js:512 Promise._settlePromiseFromHandler
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:512:31

  • promise.js:569 Promise._settlePromise
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:569:18

  • promise.js:614 Promise._settlePromise0
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10

  • promise.js:694 Promise._settlePromises
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18

  • async.js:138 _drainQueueStep
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:138:12

  • async.js:131 _drainQueue
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:131:9

  • async.js:147 Async._drainQueues
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:147:5

  • async.js:17 Immediate.Async.drainQueues [as _onImmediate]
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:17:14

success source and transform nodes — 0.603 s
error Cannot read property 'internal' of undefined

TypeError: Cannot read property 'internal' of undefined

  • infer-graphql-type.js:225 _.uniqBy.v
    [crunchyhomecreations.com]/[gatsby]/dist/schema/infer-graphql-type.js:225:44

  • lodash.js:4282 baseUniq
    [crunchyhomecreations.com]/[lodash]/lodash.js:4282:35

  • lodash.js:8420 Function.uniqBy
    [crunchyhomecreations.com]/[lodash]/lodash.js:8420:40

  • infer-graphql-type.js:225 inferFromFieldName
    [crunchyhomecreations.com]/[gatsby]/dist/schema/infer-graphql-type.js:225:15

  • infer-graphql-type.js:359 _.each
    [crunchyhomecreations.com]/[gatsby]/dist/schema/infer-graphql-type.js:359:23

  • lodash.js:4911
    [crunchyhomecreations.com]/[lodash]/lodash.js:4911:15

  • lodash.js:2996 baseForOwn
    [crunchyhomecreations.com]/[lodash]/lodash.js:2996:24

  • lodash.js:4880
    [crunchyhomecreations.com]/[lodash]/lodash.js:4880:18

  • lodash.js:9344 Function.forEach
    [crunchyhomecreations.com]/[lodash]/lodash.js:9344:14

  • infer-graphql-type.js:338 _inferObjectStructureFromNodes
    [crunchyhomecreations.com]/[gatsby]/dist/schema/infer-graphql-type.js:338:5

  • infer-graphql-type.js:409 inferObjectStructureFromNodes
    [crunchyhomecreations.com]/[gatsby]/dist/schema/infer-graphql-type.js:409:10

  • build-node-types.js:138 inferFields
    [crunchyhomecreations.com]/[gatsby]/dist/schema/build-node-types.js:138:26

  • build-node-types.js:187 fields
    [crunchyhomecreations.com]/[gatsby]/dist/schema/build-node-types.js:187:19

  • Array.forEach

error UNHANDLED REJECTION

TypeError: Cannot read property 'internal' of undefined

  • infer-graphql-type.js:225 _.uniqBy.v
    [crunchyhomecreations.com]/[gatsby]/dist/schema/infer-graphql-type.js:225:44

  • lodash.js:4282 baseUniq
    [crunchyhomecreations.com]/[lodash]/lodash.js:4282:35

  • lodash.js:8420 Function.uniqBy
    [crunchyhomecreations.com]/[lodash]/lodash.js:8420:40

  • infer-graphql-type.js:225 inferFromFieldName
    [crunchyhomecreations.com]/[gatsby]/dist/schema/infer-graphql-type.js:225:15

  • infer-graphql-type.js:359 _.each
    [crunchyhomecreations.com]/[gatsby]/dist/schema/infer-graphql-type.js:359:23

  • lodash.js:4911
    [crunchyhomecreations.com]/[lodash]/lodash.js:4911:15

  • lodash.js:2996 baseForOwn
    [crunchyhomecreations.com]/[lodash]/lodash.js:2996:24

  • lodash.js:4880
    [crunchyhomecreations.com]/[lodash]/lodash.js:4880:18

  • lodash.js:9344 Function.forEach
    [crunchyhomecreations.com]/[lodash]/lodash.js:9344:14

  • infer-graphql-type.js:338 _inferObjectStructureFromNodes
    [crunchyhomecreations.com]/[gatsby]/dist/schema/infer-graphql-type.js:338:5

  • infer-graphql-type.js:409 inferObjectStructureFromNodes
    [crunchyhomecreations.com]/[gatsby]/dist/schema/infer-graphql-type.js:409:10

  • build-node-types.js:138 inferFields
    [crunchyhomecreations.com]/[gatsby]/dist/schema/build-node-types.js:138:26

  • build-node-types.js:187 fields
    [crunchyhomecreations.com]/[gatsby]/dist/schema/build-node-types.js:187:19

  • Array.forEach

@adamrasheed Please try using the new version 2.0.5 of gatsby-source-shopify and see if this works for you. This change should fix your issue - https://github.com/gatsbyjs/gatsby/pull/10955

That seemed to fix it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

magicly picture magicly  ·  3Comments

hobochild picture hobochild  ·  3Comments

brandonmp picture brandonmp  ·  3Comments

Oppenheimer1 picture Oppenheimer1  ·  3Comments

theduke picture theduke  ·  3Comments