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
[gatsby-source-wordpress] fails with an error after a Woocommerce product is edited in Wordpress. #32712
Comments
@Petermhen Did you find any workaround for this? |
Unfortunately I've not found any way to get gatsby-source-wordpress to update products without clearing the cache. The only possible solution that I've found so far is reverting to the older "gatsby-source-woocommerce" plugin & manually triggering rebuilds. I think this is what last worked for me. Still have to verify though. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Replying to keep open as issue is still unresolved and is a major problem. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Thanks again for being part of the Gatsby community! 💪💜 |
Bump. This is a critical error as updating Woocommerce products isn't exactly an obscure use case. Any progress on this issue by chance? |
Preliminary Checks
Description
I'm using the gatsby-source-wordpress Gatsby plugin along with WPGatsby, WooGraphQL & Woocommerce Wordpress plugins to source Woocommerce product data into Gatsby.
After building the website using "gatsby develop", on editing a Woocommerce product or creating a new Woocommerce product in the Wordpress Admin, gatsby-source-wordpress fails with an error on attempting to auto-rebuild the Woocommerce product change using cache.
On ending the development server process and running "gatsby develop" again, the site builds successfully but any changes made to Woocommerce products or new products created aren't shown.
The changes to existing Woocommerce products & newly created products show up when products are queried in the GraphiQL IDE in the Wordpress Admin interface (so it doesn't seem to be an issue with the WooGraphQL plugin), but not when products are queried in the Gatsby site's GraphiQL IDE (http://localhost:8000/___graphql).
The only way to have changes to Woocommerce products or newly created products show up on the site and in Gatsby's GraphiQL IDE is to rebuild the site from scratch without cache, by running "gatsby clean && gatsby develop" after every Woocommerce product update.
In Production on Netlify the same happens. Product changes trigger the Netlify build hook, which successfully completes the build, but no edits to existing products or newly created products show up in the new build. The only solution is to clear the cache and do a lengthy rebuild from scratch using the "Clear cache and rebuild" button in Netlify's interface.
gatsby-source-wordpress detects changes and rebuilds using cache successfully (changes show up on the website) on edits to any other content in Wordpress, such as Wordpress posts, Advanced custom fields, Pages,etc. The error & failure to build changes unless cache is cleared only happens on updates to Woocommerce products.
Auto Rebuilding on detected changes to Woocommerce products previously worked fine until I updated my Gatsby packages & Wordpress plugins & neglected to test this feature. I've tried retracing my steps to figure out what update may have introduced the problem, but I've been unsuccessful so far.
I've tried updating all packages to the latest versions & I still get the error. I then updated all packages to their unstable "next" versions, but I get the same error still.
Reproduction Link
https://codesandbox.io/s/wizardly-boyd-jev0o?file=/gatsby-config.js
Steps to Reproduce
I've been able to reproduce this error using the Gatsby starter template with minimal changes to it along with a fresh Wordpress installation.
The CodeSandbox reproduction link that I've given reproduces the error, however you'll need to swap out the wordpress server link in "gatsby-config.js" with your Wordpress server & make an edit to a Woocommerce product to trigger a rebuild, at which point you should see the error.
...
Expected Result
Gatsby-source-wordpress detects the change to the Woocommerce product & rebuilds only the edits made to the Woocommerce product using cache. The product changes show up on the website after rebuild completes.
Actual Result
Gatsby-source-wordpress fails with an error after a change is made to a Woocommerce product or a new product is created. The changes to the Woocommerce product do not show up on the website.
Console log showing the error:
Environment
Config Flags
None
The text was updated successfully, but these errors were encountered: