gatsby-starter-casper icon indicating copy to clipboard operation
gatsby-starter-casper copied to clipboard

Homepage won't update after changing post content.

Open ZacharyChim opened this issue 6 years ago • 5 comments

Hi, I'm new to Gatsby and Casper. I notice that after changing the post content, the homepage won't update with the new data(post title, link, cover image). I tried to refresh the homepage, but it still shows the old content. The problem is there is no error in command line nor Console in Chrome, I don't know where to start to fix it.

Here is my repository: https://github.com/ZacharyChim/zacklivecom

ZacharyChim avatar Apr 02 '18 16:04 ZacharyChim

+1

rhysdavies1994 avatar Apr 04 '18 10:04 rhysdavies1994

Same problem, have not yet find how to fix it.

kriskaminski avatar Apr 08 '18 16:04 kriskaminski

I guess I found a solution. The reason was cache. Just npm run clean or yarn run clean It might be nice to add hot reload of main page.

kriskaminski avatar Apr 08 '18 21:04 kriskaminski

Same issue here. I think it's something to do with the pagination plugin.

This repo seems to have the same issue and is also doing pagination: https://github.com/Harrison1/gatlify

martynhoyer avatar Apr 14 '18 12:04 martynhoyer

Hey guys! @martynhoyer is close to the mark. Basically, Gatsby calls createPages once per build, and it's in that method that all of the pagination pages are created and their data is cached. Maybe I'll revisit this issue if I have the time. Most of the workarounds are crude and still cache, but might be better for less saavy techinical users.

For now, the best workaround is to just run:

npm run clean && npm run develop

haysclark avatar May 02 '18 00:05 haysclark