Skip to content
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

New data in createPage does not update between builds #29086

Closed
grebbanniclas opened this issue Jan 19, 2021 · 1 comment
Closed

New data in createPage does not update between builds #29086

grebbanniclas opened this issue Jan 19, 2021 · 1 comment
Labels
topic: data Relates to source-nodes, internal-data-bridge, and node creation type: bug An issue or pull request relating to a bug in Gatsby

Comments

@grebbanniclas
Copy link

Description

The problem is that the page context is not updating when I fetch data from my API. So if I do a build, change the data in my API, and then do another build, the the pages aren't updated.

I'm using Gatsby 2.30.3 (I've had this issue on earlier versions as well). When I'm fetching data from an API in createPages the context for the pages does not update, and when using develop the __graphQL endpoint is updated but not the pages. I have tried to boil this down to a very simple use case to make sure that other plugins etc. aren't the cause, and I have gotten down to a really minimal example where the problem still persists.

Steps to reproduce

To reproduce the error all I have to do is to run:

  1. gatsby clean
  2. gatsby develop - (here the data in /__graphQL and the page is the same)
  3. gatsby develop - (the data in /__graphQL data is updated, but the page shows the same data as in the previous run)

grebbanniclas/gatsby-build-issue@48322c1

First run of gatsby develop - same data

image

Second run of gatsby develop - different data

image

Expected result

The data shown on the page should update between builds when the data I put into createPage changes.

Actual result

It does not update.

Environment

  System:
    OS: macOS 11.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.15.4 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.10 - /usr/local/bin/npm
  Languages:
    Python: 2.7.17 - /usr/local/bin/python
  Browsers:
    Chrome: 87.0.4280.141
    Firefox: 84.0.1
    Safari: 14.0.2
  npmPackages:
    gatsby: ^2.26.1 => 2.30.3
    gatsby-image: ^2.5.0 => 2.9.0
    gatsby-plugin-manifest: ^2.6.1 => 2.10.0
    gatsby-plugin-offline: ^3.4.0 => 3.8.0
    gatsby-plugin-react-helmet: ^3.4.0 => 3.8.0
    gatsby-plugin-sharp: ^2.8.0 => 2.12.2
    gatsby-source-filesystem: ^2.5.0 => 2.9.1
    gatsby-transformer-sharp: ^2.6.0 => 2.10.1
  npmGlobalPackages:
    gatsby-cli: 2.12.71
@grebbanniclas grebbanniclas added the type: bug An issue or pull request relating to a bug in Gatsby label Jan 19, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 19, 2021
@vladar
Copy link
Contributor

vladar commented Jan 19, 2021

Hey @grebbanniclas! Thanks for opening this.

It is a known issue. We have a PR in progress to address this which you can track here: #28590

In the meantime, I am closing this as a duplicate of #26520. Feel free to comment and mention me if you think this issue is different and want to re-open it.

@vladar vladar closed this as completed Jan 19, 2021
@vladar vladar added topic: data Relates to source-nodes, internal-data-bridge, and node creation and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: data Relates to source-nodes, internal-data-bridge, and node creation type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

2 participants