cedricdelpoux / gatsby-source-google-docs

Gatsby plugin to use Google Docs as a data source
https://cedricdelpoux.github.io/gatsby-source-google-docs/
MIT License
212 stars 58 forks source link

Freeze when fetching documents #261

Open ehannes opened 2 months ago

ehannes commented 2 months ago

I've been using this plugin for a long time on several sites. Now suddenly for one site, the plugin freeze during build. I've enabled debug and this is what I get:

yarn start
yarn run v1.22.19
$ gatsby develop
success compile gatsby files - 0.291s
success load gatsby config - 0.029s
success load plugins - 1.112s
warn gatsby-plugin-react-helmet: Gatsby now has built-in support for modifying the document head. Learn more at https://gatsby.dev/gatsby-head
success onPreInit - 0.020s
success initialize cache - 0.066s
success copy gatsby files - 0.137s
success Compiling Gatsby Functions - 0.130s
success onPreBootstrap - 0.155s
success createSchemaCustomization - 0.077s
FETCHING SHEET [AsyncFunction: fetchData]
FETCHING SHEET [AsyncFunction: fetchData]
FETCHING SHEET [AsyncFunction: fetchData]
⠸ source and transform nodes
⠼ source-google-docs — fetching Google Docs documents
⠼ source-google-docs: documents — fetching documents

and then it's just stuck there. The dots on the left of the last three outputs are also frozen and the whole build is frozen. The same thing happens on Netlify when I try to deploy the site, so it's unrelated to my computer.

When I worked with the site just a few days ago everything worked as expected. Then suddenly, during content updates on Google Docs, this happened and continues to happen every run. There's no code changes involved and no plugin updates.

It seems to me as if some error handling is missing. I would very much appreciate help with troubleshooting this issue.

I would also like to take the opportunity to thank you for a great plugin, I've had much use of it! 😄

Versions

yarn gatsby -v
yarn run v1.22.19
$ ~/workspace/example.com/node_modules/.bin/gatsby -v
Gatsby CLI version: 4.25.0
Gatsby version: 4.25.7
  Note: this is the Gatsby version for the site at: ~/workspace/example.com

✨  Done in 0.89s.
yarn why gatsby-source-google-docs
yarn why v1.22.19
[1/4] 🤔  Why do we have the module "gatsby-source-google-docs"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "gatsby-source-google-docs@2.4.3"
info Has been hoisted to "gatsby-source-google-docs"
info This module exists because it's specified in "dependencies".
info Disk size without dependencies: "2.16MB"
info Disk size with unique dependencies: "134.06MB"
info Disk size with transitive dependencies: "175.54MB"
info Number of shared dependencies: 175
✨  Done in 0.93s.
ehannes commented 2 months ago

I managed to get a successful build yesterday. I revered the changes I had made the other day to the Google document and then it worked. Then I added back part of the content again, piece by piece until the build froze again. Then I rewrote the part of the text that crashed the build and continued until the document could be fetched again. So I guess there was something in the text, maybe some custom formatting, that crashed the fetching document part of this plugin.

So I think there's a problem with the error handling while fetching/parsing the Google document that makes the build freeze and no error message is shown.

cedricdelpoux commented 2 months ago

Hello @ehannes. Thanks for reporting this. Could you share the document that break the build?

ehannes commented 2 months ago

I'll try to copy the document and create a minimal reproducible example. How can I share the link with you without posting it here publicly on GitHub?

cedricdelpoux commented 2 months ago

Please sent it to my email address. You can find it in my profile