gatsbyjs / gatsby-source-wordpress-experimental

The upcoming v4 of gatsby-source-wordpress, currently in beta
MIT License
385 stars 100 forks source link

Wordpress updates are not picked up by gatsby-develop & gatsby-build without gatsby clean #386

Closed insidesmart closed 3 years ago

insidesmart commented 3 years ago

Up until version 2.1.3, wordpress changes were propagating to gatsby-develop process.

After upgrade to 6.0.0 (gatsby latest version. also upgraded all the required wordpress plugins to the latest), the updates are not reflected in gatsby develop within nodeUpdateInterval time.

Sadly even if i attempt gatsby-develop / gatsby build as a fresh command, the updates are not picked up. If we do gatsby clean and then gataby develop / gatsby build, wordpress updates are picked up as expected.

(Not added any environment variables like ENABLE_GATSBY_REFRESH_ENDPOINT)

brandensilva commented 3 years ago

Also experiencing this problem. I'm on gatsby-source-wordpress-experimental: 5.0.2.

I will report back with more details when I get a moment.

muradbu commented 3 years ago

I'm also experiencing this problem.

gatsby-source-wordpress-experimental v6.0.0, gatsby v2.29.2, WordPress v5.6, WP Gatsby v0.9.1, WP Graphql v1.0.3

tj-mc commented 3 years ago

Appear to facing this issues also. Can't determine what has changed to trigger this.

TylerBarnes commented 3 years ago

Is anyone able to share a reproduction repo?

TylerBarnes commented 3 years ago

https://github.com/gatsbyjs/gatsby-source-wordpress-experimental/pull/400 may fix this problem. I identified and fixed an issue there that seemed very similar. I'll post here once that's released so you can try it out :)

TylerBarnes commented 3 years ago

I believe this is fixed in gatsby-source-wordpress-experimental@6.1.0. Please try it out and let me know if you're still having issues. If you are, we'll need a reproduction to tackle this one. Thanks everyone!

robertschneiderman commented 3 years ago

I have this same problem. Upgrading to 6.1.0 doesn't seem to work :/ I upgraded all the way from 1.7.9 => 6.0.0, so I can't pinpoint where this breaks... but things were working great on 1.7.9

TylerBarnes commented 3 years ago

@robertschneiderman are you able to share a reproduction so we can fix it? Thanks :)

mikexavier commented 3 years ago

I'm not sure if this is the same issue or not, as it's not necessarily anything to do with updating data on WP.

I'm getting a TypeError: Cannot read property 'adventureParkGlobal' of null in gatsby-node.js but only on the second time I run gatsby build after I've cleared the cache with gatsby clean. When running gatsby build after clearing the cache, it builds with no issue.

Some more details over here (as @jasonbahl called out above) if needed.

@TylerBarnes you're on the repo still, and I've added @jasonbahl in case you want to have a look.

RobinSJames commented 3 years ago

This may seem like an annoying fix and calling it a solution would be blasphemous, however I've added gatsby clean to each script that was causing the issue.

For example: "develop": "gatsby clean && gatsby develop --port 3000",

I say this is a fix and not a solution because changes on WordPress would be watched yet I was still asked to restart Gatsby in the terminal in order for the changes to take affect.

brandensilva commented 3 years ago

This appears to impact production builds too. In other words, my client's production site is not picking up incremental data changes via WordPress when they change content. If I issue a manual re-build via Gatsby with clearing cache and rebuilding it seems to work.

I've upgraded to these versions recently and am still experiencing this issue:

One thing worth mentioning is I'm using a Sage built custom theme and trellis build for handling the back-end. I'm curious to what others are using who are experiencing this issue.

@TylerBarnes What can I do on my end to help you diagnose this better? One thing I've witnessed is the terminal shows updates coming through and they appear to be recognized but upon refreshing (or clearing browser cache and refreshing) the changes do not persist to local environment and I appear to be experiencing the same issue on production builds. If I clear cache and trigger a manual rebuild the changes come through in Gatsby Cloud.

mikexavier commented 3 years ago

@brandensilva I use local, then using updraftplus back up the local version, upload to the remote version, and restore from the backup.

@TylerBarnes, @jasonbahl did you guys get a chance to have a look at the repo I shared? Any joy?

smthomas commented 3 years ago

@mikexavier are you still running into this problem? If you share the repo with me I can take a look.

@brandensilva are you able to reproduce this issue locally? If so, check to see if you can see the changes in graphiql after they appear to come through. If the changes show in Graphiql then it's possible it's a problem with the graphql queries (either in your code or in the plugin). If the changes are never making it to Graphiql, then it's a problem with the node sourcing step of the plugin.

brandensilva commented 3 years ago

@smthomas My issue appeared to be I was using createPagesStatefully over createPages API. As such things were not updating for me because of the differences in these APIs. Hopefully this helps someone else who might have fumbled up which API to use to generate pages!

smthomas commented 3 years ago

There are some updated docs for those that might be running into some of these problems:

mikexavier commented 3 years ago

@smthomas since some recent updates, all seems to be working as expected :) Thanks for checking in.

smthomas commented 3 years ago

This issues seems to be more quiet lately. I think a lot of these related issues were fixed in recent updates. If you update and are still running into issues, please open an issue in the gatsbyjs monorepo and provide a reproduction.