When I run gatsby develop I get error as in title. I've tried to remove node_modules and 'package-lock.json` but it didn't solve my problem.
`
ERROR #11321 PLUGIN
"gatsby-source-shopify" threw an error while running the sourceNodes lifecycle:
Cannot read property 'includes' of undefined
41 | shopifyQueries = {}
42 | }) => {
43 | const client = (0, _createClient.createClient)(shopName, accessToken, apiVersion);
| ^
44 | const defaultQueries = {
45 | articles: _queries.ARTICLES_QUERY,
46 | blogs: _queries.BLOGS_QUERY,
File: node_modules/gatsby-source-shopify/gatsby-node.js:43:49
TypeError: Cannot read property 'includes' o f undefined
create-client.js:14 createClient
[fiventhree]/[gatsby-source-shopify]/creat e-client.js:14:16
gatsby-node.js:43 Object.sourceNodes
[fiventhree]/[gatsby-source-shopify]/gatsb y-node.js:43:49
api-runner-node.js:347 runAPI
[fiventhree]/[gatsby]/dist/utils/api-runne r-node.js:347:37
api-runner-node.js:466 Promise.catch.decor ateEvent.pluginName
[fiventhree]/[gatsby]/dist/utils/api-runne r-node.js:466:15
From previous event:
api-runner-node.js:466 Promise.catch.decor ateEvent.pluginName
[fiventhree]/[gatsby]/dist/utils/api-runne r-node.js:466:7
From previous event:
api-runner-node.js:465
[fiventhree]/[gatsby]/dist/utils/api-runne r-node.js:465:12
timers.js:439 processImmediate
internal/timers.js:439:21
From previous event:
api-runner-node.js:459
[fiventhree]/[gatsby]/dist/utils/api-runne r-node.js:459:11
From previous event:
api-runner-node.js:366 module.exports
[fiventhree]/[gatsby]/dist/utils/api-runne r-node.js:366:12
source-nodes.js:89 _default
[fiventhree]/[gatsby]/dist/utils/source-no des.js:89:36
source-nodes.js:30 sourceNodes
[fiventhree]/[gatsby]/dist/services/source -nodes.js:30:34
interpreter.js:721 Interpreter.exec
[fiventhree]/[xstate]/lib/interpreter.js:7 21:27
interpreter.js:223 Interpreter.execute
[fiventhree]/[xstate]/lib/interpreter.js:2 23:22
interpreter.js:243 Interpreter.update
[fiventhree]/[xstate]/lib/interpreter.js:2 43:18
interpreter.js:144
[fiventhree]/[xstate]/lib/interpreter.js:1 44:23
scheduler.js:59 Scheduler.process
[fiventhree]/[xstate]/lib/scheduler.js:59: 13
scheduler.js:43 Scheduler.schedule
[fiventhree]/[xstate]/lib/scheduler.js:43: 14
interpreter.js:140 Interpreter.send
[fiventhree]/[xstate]/lib/interpreter.js:1 40:29
interpreter.js:836 actor.id
[fiventhree]/[xstate]/lib/interpreter.js:8 36:23
`
here's my gatsby-config.js file:
...
{
resolve:gatsby-source-shopify,
options: {
shopName: process.env.GATSBY_SHOP_NAME,
accessToken: process.env.GATSBY_STOREFRONT_ACCESS_TOKEN,
apiVersion: '2020-04',
verbose: true,
includeCollections: ['shop', 'content'],
},
},
....
previously I was trying to fetch data with 2020-07 API version but it also didn't work.
no idea yet
gatsby should fetch all data from shopify
gatsby throws #11321 error
System:
OS: macOS 10.15.6
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.14.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.7 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 84.0.4147.89
Firefox: 78.0.1
Safari: 13.1.2
npmPackages:
gatsby: ^2.17.4 => 2.24.10
gatsby-cli: ^2.12.62 => 2.12.65
gatsby-image: ^2.2.29 => 2.4.13
gatsby-plugin-google-analytics: ^2.0.13 => 2.3.13
gatsby-plugin-layout: ^1.0.11 => 1.3.10
gatsby-plugin-manifest: ^2.2.23 => 2.4.20
gatsby-plugin-offline: ^3.0.16 => 3.2.20
gatsby-plugin-react-helmet: ^3.1.13 => 3.3.10
gatsby-plugin-root-import: ^2.0.5 => 2.0.5
gatsby-plugin-sharp: ^2.2.32 => 2.6.21
gatsby-plugin-styled-components: ^3.3.10 => 3.3.10
gatsby-plugin-transition-link: ^1.20.2 => 1.20.2
gatsby-plugin-web-font-loader: ^1.0.4 => 1.0.4
gatsby-source-filesystem: ^2.1.33 => 2.3.22
gatsby-source-graphql: ^2.6.2 => 2.6.2
gatsby-source-shopify: ^3.2.24 => 3.2.24
gatsby-transformer-sharp: ^2.3.0 => 2.5.11
npmGlobalPackages:
gatsby-cli: 2.12.60
I figured out that environment variables were declared in wrong way and it was a reason of error. This thread can be closed.
@jack0wsky Thanks for the follow-up! Also, the PR with a better error message is very welcome if you can find a moment!
@jack0wsky Hi mister. Could you explain what was wrong with your env variable declaration and how you fixed it ? I'm facing the exact same probleme but I can't fin a solution.
Thank you !
@jack0wsky Hi mister. Could you explain what was wrong with your env variable declaration and how you fixed it ? I'm facing the exact same probleme but I can't fin a solution.
Thank you !
Actually I don't remember right now, but I will check later and let you know.
@jack0wsky Ok I thank you very much for that but I don't need it anymore in fact. It was just a stupid check I forgot to do. I just copied '.env.xxxxxxxxx' files a colleague sent me, but he removed the "." at the beginning of the filename, and I didn't check if the filename was correct. Without the '.' at the beginning of the filename the dotenv config wasn't able to find my env files...
I am running into this issue after building off of the hello-world-starter. Is there a way to get more from the error message than
"Cannot read property 'includes' of undefined". I don't even know where to begin looking for that.
I had the same error but I managed to fix it by reverting my webpack to version 4.44.2.
I had the same error but I managed to fix it by reverting my webpack to version 4.44.2.
Same as me. Now we need to figure out why. I'm using Gatsby with Typescript.