Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'worksheets' of undefined #45

Closed
dsdannynikravesh opened this issue Aug 17, 2021 · 15 comments
Closed

TypeError: Cannot read property 'worksheets' of undefined #45

dsdannynikravesh opened this issue Aug 17, 2021 · 15 comments

Comments

@dsdannynikravesh
Copy link

dsdannynikravesh commented Aug 17, 2021

Hi all! I know this Error is highlighted at the bottom of the README under Troubleshooting.

  • If you get the error "Cannot read property 'worksheets' of undefined", make sure you have shared your spreadsheet with your service account user.

Followed the troubleshooting suggestions and I am still left with the error.

I weirdly received this error yesterday, and made sure that the service account user had been shared with the spreadsheet. Creating a new service account however seemed to temporary fix the issue until now.

Getting the same error and creating a new service account is not able to fix the issue this time.

Let me know if theres any further information I can provide! Any help is much appreciated! Thank you!

@rajan-magar
Copy link

rajan-magar commented Aug 18, 2021

Same issue on this side.
FYI @brandonmp @MartinNuc @drewatk @KyleAMathews @britt @j-nolan

@div-cowboy
Copy link

Same issue

@advisciglio
Copy link

advisciglio commented Aug 18, 2021

This seems to be related to #39, caused by the Google API V3 version being recently deprecated.

Provided this plugin doesn't seem to be supported anymore, I suggest replacing it with https://github.com/sondrele/gatsby-source-google-spreadsheet. I could replace it successfully in my project; there are minor implementation differences but overall it's pretty much the same.

Some differences I stumbled upon:

  • The new plugin retrieves all sheets with one configuration object (as opposed to one object per sheet)
  • The new plugin returns boolean values (checkboxes) as TRUE or FALSE strings
  • The graphql node types have a different type (allGoogleSheetSheetnameRow vs. allGoogleSpreadsheetSheetname)

@rajan-magar
Copy link

@advisciglio Agree. It seems they dropped it on 2nd August, 2021 and its weird we are facing this issue since 16 August, 2021. Anyway, i have gone through the migration part and noticed the changed the URL's for API which we might need to implement here in this project. So we can use the same plugin instead of going to another plugin.
FYI @brandonmp @MartinNuc @drewatk @KyleAMathews @britt @j-nolan

@ehannes
Copy link

ehannes commented Aug 26, 2021

@rajan-magar are you working with a migration? Would be great to be able to continue using this plugin, we use it in several projects.

I also opened #46 to see if we can get in touch with the author of this plugin since it seems abandoned. Otherwise, we might need to fork it... Maybe start a community around it?

I will also take a deeper look at the suggested alternative above, though latest update there is also old: Oct 30, 2019...

@ehannes
Copy link

ehannes commented Sep 8, 2021

Looks like @yeswanth has a working version here: https://github.com/yeswanth/gatsby-source-google-sheets.
Also looks like @advisciglio has one here: https://github.com/advisciglio/gatsby-source-google-sheets

Any chance we can create a GitHub organisation and work together on a successor of this plugin instead of building our own versions? 😄

@advisciglio
Copy link

advisciglio commented Sep 8, 2021

@ehannes I ended up using https://github.com/sondrele/gatsby-source-google-spreadsheet to fix the Google API issue. The repo you reference is a fork from the original that I had to make in order to bridge the Gatsby v2 to v3 issue, but I think it still has permission failures (I stopped using it altogether).

@yeswanth
Copy link

yeswanth commented Sep 9, 2021

@ehannes Definitely a good idea. I would love to collaborate with you on this.

@ehannes
Copy link

ehannes commented Sep 11, 2021

@yeswanth are your version of the plugin working? If so, then maybe we could continue with either:

  • Create an organisation here on Github so that we co-own the project
  • Or invite me and hopefully other collaborators to your repository
  • Or at least open it up your repository so that one can submit issues

Would also be nice if we could release the plugin officially at npmjs.org.

Maybe you could contact me at [email protected] to discuss the details further? Thanks for wanting to share 😄

@ehannes
Copy link

ehannes commented Sep 11, 2021

@advisciglio good that you found a solution. Is that other plugin maintained? It has just 15 commits and last one was made Oct 30, 2019. Does it support Gatsby v3?

@advisciglio
Copy link

advisciglio commented Sep 11, 2021

@ehannes I am using it with V2 but I think it should work on V3 as well.

In gatsby-source-google-sheets, the v3 incompatibility relies on the usage of boundActionCreators, which was deprecated in favor of actions (see https://www.gatsbyjs.com/docs/reference/release-notes/migrating-from-v2-to-v3/#removal-of-boundactioncreators).

gatsby-source-google-spreadsheet uses actions, for which I assume it should work with Gatsby v3.

In regards to plugin maintenance, yes, it looks less popular and equally abandoned.

@ehannes
Copy link

ehannes commented Sep 23, 2021

@yeswanth any change we can get in contact? 😃

@yeswanth
Copy link

@advisciglio Yes, I just sent you a mail :)

@ehannes
Copy link

ehannes commented Oct 13, 2021

Unfortunately, this repository seems completely abandoned, and as this issue describes, it's also broken. @yeswanth and I have decided to use his working fork of the project and continue maintenance there. So, if anyone is interested, you can find it here: https://github.com/yeswanth/gatsby-source-google-sheets.

@dsdannynikravesh
Copy link
Author

As per @ehannes message above I am closing this as it is apparent that this plugin is no longer functional with Google updating their API and this plugin not being maintained.

Ive decided to move the google sheets into a csv folder within the repository and use gatsby-transormer-csv as a quick solution.

For anyone wanting a google-sheets plugin see @ehannes' link above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants