-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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 to build site #5371
Comments
Can you try excluding some of the WP API routes? |
After adding some debug output:
I will add handling of that soonish. Getting stuck without output would almost certainly be happening while pulling images, some kind of error that we don't handle (or handle correctly), will need to investigate more |
Thanks for looking into my issues What is the best/easiest way to try out the changes in these new commits? |
You'll have to wait for next npm publish - so probably few days. I'll notify here when it's done, so you could update your packages Alternatively You could try to apply changes to your local node_modules packages, but be prepared for hardly readable transpiled scripts there. |
I'll wait. Thanks! |
Not sure of a new version has been published but I was able to run I also looked at my WordPress database and confirmed that there is a comment with an ID of 6681 Not sure how to square that with the debug output, but comment 6681 is a ping back so maybe thats it |
As test I removed the comment type field for comment 6681 so Wordpress would no longer thinks its a pingback and now even with the comments API endpoint re-enabled it works. Looks like Gatsby doesn't like pingbacks as parents. Not sure if the issue lies with the WordPress API or gatsby, but the end result isn't a pleasant experience Regardless it works now. Time for me to figure out how to build something nice:) |
I was able to fix this issue by adjusting the amount of concurrent items were in the queue in the gatsby-source-filesystem plugin:
It would be nice to have an option in the gatsby-source-filesystem to adjust the amount of concurrent requests that are in the queue. That way on a lesser powerful machine, so the node process doesn't lock up. Changing it between 1-50 concurrent requests fixed this for me. |
I thought adding |
@scruffydan there couple request queues running under the hood - wordpress plugin has queue for REST endpoints (controlled by |
@KyleAMathews + @scruffydan How do we exclude some of the WP API routes? I've looked at not including them on the WP server side of things, but is there a way inside Gatsby? |
@jonathanbell In case you're still wondering, see the |
@lightstrike Thank you! |
Hey,
whereas it works with other base URL. Any ideas ? thanks |
@pmarxbraun check your posts if they have tags, at least one tag and categories. based on the error you posted it looks like that's the case. Check if that's the case and once the posts are updated, issue |
@jonniebigodes thanks for your help. It does not seem to work :-( All posts have categories and tags.
Thanks again for you help 👍 |
@jonniebigodes Any ideas about this ? thanks again for your help |
@pmarxbraun can you share your |
@jonniebigodes here it is :-)
|
@pmarxbraun sorry for the wait. And i think i have a solution for your case. What i did was:
With that it led me to believe that you followed probably this and this. Which is correct, but not accurate entirely. With this you'll get into some errors like you did.
module.exports = {
/* Your site config here */
plugins:[
{
resolve: `gatsby-source-wordpress`,
options: {
/*
* The base URL of the WordPress site without the trailingslash and the protocol. This is required.
* Example : 'dev-gatbsyjswp.pantheonsite.io' or 'www.example-site.com'
*/
baseUrl: `we-chain.com`,
// The protocol. This can be http or https.
protocol: `https`,
// Indicates whether the site is hosted on wordpress.com.
// If false, then the asumption is made that the site is self hosted.
// If true, then the plugin will source its content on wordpress.com using the JSON REST API V2.
// If your site is hosted on wordpress.org, then set this to false.
hostingWPCOM: false,
// If useACF is true, then the source plugin will try to import the WordPress ACF Plugin contents.
// This feature is untested for sites hosted on WordPress.com
useACF: false,
includedRoutes: [
"**/posts",
"**/pages",
"**/media",
"**/categories",
"**/tags",
],
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
]
}
As you can see, the error was fixed. |
@jonniebigodes Thanks a lot ! I works now :-) |
I am trying to build my first gatsby powered site, using my current WordPress site (1000 posts and almost 3000 pictures) as a source for gatsby and I cannot get it to build. So far I have just the basic site generated by
gatsby new
and thegatsby-source-wordpress
plugin. My gatsby site is published here https://github.com/scruffydan/MindofDanDescription
gatsby develop
doesn't completeThis is what I get:
I am using
verboseOutput: true
andconcurrentRequests: 10
.It just hangs at source and transform nodes and never completes. I have left it running for 12 hours.
However I don't always get the
TypeError: Cannot read property 'id' of undefined
error, sometimes it just hangs at source and transform nodes.Steps to reproduce
Clone the repo https://github.com/scruffydan/MindofDan
run
npm install
run
gatsby develop
Expected result
The site should build
Actual result
gatsby hangs and doesn'tcomplete
Environment
npm list gatsby
): gatsby@1.9.259gatsby --version
): 1.1.52File contents (if changed)
gatsby-config.js
:package.json
:gatsby-node.js
: N/Agatsby-browser.js
: N/Agatsby-ssr.js
: N/AThanks in advance
The text was updated successfully, but these errors were encountered: