-
Notifications
You must be signed in to change notification settings - Fork 60
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
Intermittent results on Gatsby Build #83
Comments
For what it's worth I also often experience intermittent build problems with missing data. I noticed your number of page queries differs between the successful run:
And the unsuccessful one:
This is always my first indicator that something is broken. If I stop, run I've not yet been able to identify whether the race condition that's causing this is in my code, Gatsby, or the Sanity plugin. The fact you're having this problem with a Sanity starter certainly leads me to think it's the plugin. Did Sanity ever respond via other channels? I haven't found them very responsive, and I'm starting to worry it's time to look around for another CMS. |
@aaronadamsCA that's an interesting observation that I didn't notice originally. Yea something strange is happening and now unfortunately There definitely seems to be some kind of race condition but I haven't received any response on this issue. I'm not sure where is the best place to reach out to them but here or twitter didn't work. It's really a shame cause I feel like sanity is just great. |
This is a very hard issue to debug because we're not able to reproduce it. I've just released v6.0.4 of the source plugin. When building with it, it should finish the retrieval of documents from Sanity with the message "Done! Exported X documents". Could you upgrade to this version and let us know what the document counts are on both successful and unsuccessful builds? If the document count varies (more than expected) between the builds, that'll indicate some problem with the data fetching. Otherwise it might be a problem in the gatsby layer which we need to go deeper on. |
@rexxars, glad to hear it, I'll be sure to try some things out shortly (although note I am not OP). Note that I have identified a confirmed concurrency bug in Gatsby core (gatsbyjs/gatsby#26056). Given you don't make any calls to The "magic exports" we're required to define in Finally, I believe the "run page queries" count may actually count only non-cached page queries. In other words, this may be an intentional behaviour of Gatsby, with the higher count after The above are all new learnings for me in the past few weeks as I continue to learn more. I'm rebuilding my |
@rexxars I'm not sure why but upgrading to the latest version seems to have resolved the issue. |
FYI only, I've noticed that the document count you've added is consistent during all builds. I'd suppose if neither of us are experiencing issues anymore, this is probably taken care of 👍 thank you! |
Description of problem
I recently started a new gatsby project following the template repo but I did mine on a smaller scale using typescript. On my blog page I have a query to fetch all the posts I have in Sanity. For some strange when I go to build the project, sometimes I get results and other times I don't. I'm not sure I'm doing something wrong
Steps to reproduce
This is my post schema
This is my query
Results
I place two console.log statements in my component, one that prints the entire data object and one that prints the mapped posts.
Example of successful build:
Example of build without content:
Let me know if you anymore information.
The text was updated successfully, but these errors were encountered: