gatsby: TypeError: getNodesByType is not a function
Description
Hi there, I’ve been following the tutorials on gatsbyjs.org, and on part 6 I run into this issue where my app will crash whenever I try to query something with graphql.
Steps to reproduce
Here’s the github link to the project ➡️ https://github.com/ChariseWalraven/gatsby-graphql-crash
Expected result
GraphiQL and GraphQL should respond with the data from the markdown file.
Actual result
Crashed with the following error:

Environment
System:
OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
CPU: x64 AMD A10-9620P RADEON R5, 10 COMPUTE CORES 4C+6G
Shell: 5.4.2 - /usr/bin/zsh
Binaries:
Node: 11.0.0 - /usr/local/bin/node
Yarn: 1.10.1 - /usr/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 70.0.3538.67
Firefox: 62.0.3
npmPackages:
gatsby: ^2.0.0 => 2.0.32
gatsby-plugin-emotion: ^2.0.6 => 2.0.6
gatsby-plugin-typography: ^2.2.1 => 2.2.1
gatsby-source-filesystem: ^2.0.6 => 2.0.6
gatsby-transformer-remark: ^2.1.11 => 2.1.11
npmGlobalPackages:
gatsby-cli: 2.4.4
error Couldn't find the required `xsel` binary. On Debian/Ubuntu you can install it with: sudo apt install xsel
Error: Couldn't find the required `xsel` binary. On Debian/Ubuntu you can install it with: sudo apt install xsel
- envinfo.js:1 i
[lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:105475
- envinfo.js:1 Object.copySync
[lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:106001
- envinfo.js:1 Object.t.writeSync.e [as writeSync]
[lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123499
- envinfo.js:1
[lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124274
- envinfo.js:1 Promise.all.then.e
[lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124289
- 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
- promise.js:638 Promise._fulfill
[lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:638:18
- promise_array.js:126 PromiseArray._resolve
[lib]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:126:19
- promise_array.js:144 PromiseArray._promiseFulfilled
[lib]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:144:14
- promise.js:574 Promise._settlePromise
[lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:574:26
- 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
error UNHANDLED REJECTION
Error: Couldn't find the required `xsel` binary. On Debian/Ubuntu you can install it with: sudo apt install xsel
- envinfo.js:1 i
[lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:105475
- envinfo.js:1 Object.copySync
[lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:106001
- envinfo.js:1 Object.t.writeSync.e [as writeSync]
[lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123499
- envinfo.js:1
[lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124274
- envinfo.js:1 Promise.all.then.e
[lib]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124289
- 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
- promise.js:638 Promise._fulfill
[lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:638:18
- promise_array.js:126 PromiseArray._resolve
[lib]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:126:19
- promise_array.js:144 PromiseArray._promiseFulfilled
[lib]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:144:14
- promise.js:574 Promise._settlePromise
[lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:574:26
- 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
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 12
- Comments: 16 (6 by maintainers)
This is a dependency issue. You need
gatsby2.0.33 or later.I ran into this similar error today and I deleted all my node modules & package-lock.json, ran
npm installagain, and that seemed to fix the issue. I am not entirely sure why that worked but it was a workaround that allowed me to keep moving on the tutorial. I hope that helps!The issue was that I was on an older version of Gatsby. I was on
2.0.19.Running a
yarn add gatsbyput me up to the new version.I think I might have accidentally put it back by installing a separate package. Either way, it’s what did the trick. Make sure you check your
package.jsonfile to see if your version ofgatsbyis over2.0.33like @stefanprobst said.Cheers guys ☕
simple
npm updatesolved this.I’ll conclude this issue as a dependency error! Thanks for the help everyone.
Sure thing! Here ➡️ https://github.com/gatsbyjs/gatsby-starter-hello-world/blob/master/package.json Currently the version is
2.0.0As a side note, would it be possible to update the gatsby version on the tutorial as well? I’m sure I’m not going to be the last one to have this issue if the version on the tutorial stays the same. 🤔
@elebumm Now is solved. I’m using
2.0.33and now we have a solution for the issue I reference above. I’m finally able to run develop, build and deploy to Netlify. I appreciate the help!Thanks guys. npm update solved this.
Running with the same issue using Netlify. Site builds correctly in my local but on Netlify I’m getting this error: