brandonmp / gatsby-source-google-sheets

A GatsbyJS plugin that pulls nodes from rows in a Google Sheet.
90 stars 32 forks source link

TypeError: fetchSheet is not a function #5

Closed iamjoshua closed 6 years ago

iamjoshua commented 6 years ago

After following your setup instructions, I just get the following error:

error Plugin gatsby-source-google-sheets returned an error

  TypeError: fetchSheet is not a function

  - gatsby-node.js:35 _callee$
    [me]/[gatsby-source-google-sheets]/gatsby-node.js:35:20

  - gatsby-node.js:62 Object.sourceNodes
    [me]/[gatsby-source-google-sheets]/gatsby-node.js:62:18

  - api-runner-node.js:110 runAPI
    [me]/[gatsby]/dist/utils/api-runner-node.js:110:36

  - api-runner-node.js:187 
    [me]/[gatsby]/dist/utils/api-runner-node.js:187:33

  - map.js:27 
    [me]/[gatsby]/[async]/internal/map.js:27:9

  - eachOfLimit.js:64 replenish
    [me]/[gatsby]/[async]/internal/eachOfLimit.js:64:17

  - eachOfLimit.js:49 iterateeCallback
    [me]/[gatsby]/[async]/internal/eachOfLimit.js:49:17

  - onlyOnce.js:12 
    [me]/[gatsby]/[async]/internal/onlyOnce.js:12:16

  - map.js:29 
    [me]/[gatsby]/[async]/internal/map.js:29:13

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

  - nodeify.js:23 Promise.successAdapter
    [me]/[bluebird]/js/release/nodeify.js:23:30

  - promise.js:566 Promise._settlePromise
    [me]/[bluebird]/js/release/promise.js:566:21

  - promise.js:606 Promise._settlePromiseCtx
    [me]/[bluebird]/js/release/promise.js:606:10

  - async.js:138 Async._drainQueue
    [me]/[bluebird]/js/release/async.js:138:12

  - async.js:143 Async._drainQueues
    [me]/[bluebird]/js/release/async.js:143:10
timurc commented 6 years ago

First, thanks that this is up! I set up a small (not online yet) minimal portfolio website.

It used to work, now I got the same error. I removed node_modules and re-npm-installed. I did try with node 9.5.0, 8.9.4 and 7.7.3 because I was not sure which version I started with. I did update all gatsby dependencies.

If you need more details, I would be happy to give them!

brandonmp commented 6 years ago

thanks guys, sorry for the inconvenience--i know how frustrating it is when stuff doesn't 'just work'.

just pushed a new version to npm that works locally, just let me know if that's not the case.

the cause was a change i made to the export syntax during last commit--apparently babel is weird with import/export syntax & i had to append a .default to the require()

timurc commented 6 years ago

Can confirm that it is fixed, thank you very much!