-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Conditional page builds not working with static queries #25928
Comments
I am also having this issue, where any |
This is a good change having the static queries outside of the JS bundles🙇 . The full rebuild on the static data change wasn't ideal, in the first attempt we struggled linking page paths to its static data. Just thinking how to we could go about fixing I see in the PR (#25723) there is now a staticQueryResults with a Do the |
@sidharthachatterjee @KyleAMathews can this get some love? I know you spruced up conditional page builds in V3 but this is still an outstanding issue that makes static queries worthless at the moment. |
We have tests that static queries get re-run when their data changes — https://github.com/gatsbyjs/gatsby/blob/master/integration-tests/artifacts/src/pages/static-query-result-tracking/should-invalidate.js Could you make a reproduction of what you're seeing so we can dig in more? |
Struggling to recreate in isolation, so appreciate that's not a great start. However I did dig into some of the dirty checking that Gatsby is doing and would really appreciate if you can look over my findings: I added some additional logging into this block in redux/reducers/html.ts so that I could check if it detects that my static query data has changed. This works as intended: Gatsby detects the change, flags the query as dirty and subsequently rebuilds the necessary pages. The problem, I think, is that it's not correctly reupdating this entry in the So the old hash is persisted, and the following problem is introduced:
|
#25723 has moved static queries outside of the js bundles. Previously a change to these would trigger a full rebuild which wasn't ideal. The changes made have fixed this, however now nothing is triggering so it is not possible to detect and deploy a static query change.
This effectively makes them unreliable for use with conditional page builds
The text was updated successfully, but these errors were encountered: