Navigating between programmatically created pages doesn't update data
See original GitHub issueSummary
We have a problem with programmatically generated pages displaying the wrong data if the user refreshes the page on any of the programmatically created pages and navigates to another. It then shows the data of the first page (the one that was refreshed).
Relevant information
We’re creating an e-commerce store sourcing products from Shopify and Articles from Prismic and have created Product and Article template components which export a gatsby build query. The query seems to work fine. But if you refresh the page while on any of the products and navigate to another product page, it shows all the data from the first one. The same happens for article pages. To clarify, it works perfectly if you refresh on anything but a product page or article page (if you refresh on a product page the articles still work and vice versa).
It wasn’t like that from the start, but I didn’t notice it until quite far down the line. If I run the product/article query in gatsby-node.js
it works as expected.
I wish I knew how to duplicate this, but the only way I know is to clone our repo and unfortunately, it has to be kept private.
For a demo of the issue, you can go to this link: https://quizzical-noyce-4f2028.netlify.com/product/max-burger/ and navigate to a different product. This is the old base of our project that still has the bug present in it.
Is anyone aware of anything that could cause this? Specifically that the programmatically generated pages query data doesn’t update, even though the pageContext
does?
Environment (if relevant)
System: OS: macOS 10.15.1 CPU: (12) x64 Intel® Core™ i7-8850H CPU @ 2.60GHz Shell: 5.7.1 - /bin/zsh Binaries: Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node Yarn: 1.19.2 - ~/.yarn/bin/yarn npm: 6.10.0 - ~/.nvm/versions/node/v10.15.3/bin/npm Languages: Python: 2.7.16 - /usr/bin/python Browsers: Chrome: 79.0.3945.79 Firefox: 69.0.1 Safari: 13.0.3 npmPackages: gatsby: ^2.17.7 => 2.17.7 npmGlobalPackages: gatsby-cli: 2.8.3 gatsby-source-prismic-graphql: 3.4.0-beta.2
File contents (if changed)
gatsby-config.js
: N/A
package.json
: N/A
gatsby-node.js
: N/A
gatsby-browser.js
: N/A
gatsby-ssr.js
: N/A
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
@LekoArts thanks for the Netlify suggestion. It helped me narrow down when the issue was introduced and points to 3 commits pushed a little over a month ago that enabled Prismic previews. Looks like I need to take a look at that. For documentation purposes, I will update this issue when I have the solution.
Hey again!
It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m
HUMAN_EMOTION_SORRY
. Please feel free to reopen this issue or create a new one if you need anything else. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!Thanks again for being part of the Gatsby community! 💪💜