Do not use promise.all for fetching static queries #35789
Unanswered
ankurparihar
asked this question in
Ideas / Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi team,
Recently we saw an issue on our website, where all images failed to load. Looking deep down in the issue, we found that there was one static query json that was not available or not being fetched. So it explain why would that image fail to load but it shouldn't have failed rest of the images on the page, since rest of the staticQuery jsons were available.
So we started looking into how Gatsby loads the page, and if I'm not mistaken (please correct if I'm not looking at the right place), it is using
Promise.all
to fetch them. So, even if one fails all fails.gatsby/packages/gatsby/cache-dir/loader.js
Line 288 in e7db715
Can we please move to some other strategy here, I'm happy to contribute according to the suggestions as well.
I researched a bit, and we can probably use this approach, https://stackoverflow.com/questions/31424561/wait-until-all-promises-complete-even-if-some-rejected
Beta Was this translation helpful? Give feedback.
All reactions