You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

gatsby-source-wordpress插件无法生成节点问题求助

Troubleshooting "gatsby-source-wordpress generated no Gatsby nodes" Warning

Hey there, let's work through this issue step by step—since you're new to Gatsby and WordPress integration, this is a common gotcha, so no worries!

Here are the key checks to fix the "no Gatsby nodes generated" warning:

  • Verify your plugin configuration in gatsby-config.js
    Make sure you've set up the plugin with the correct details for your self-hosted WordPress site. A basic valid config looks like this:

    plugins: [
      {
        resolve: `gatsby-source-wordpress`,
        options: {
          baseUrl: `your-wordpress-site-domain.com`, // or local URL like localhost:8888/your-wp
          protocol: `https`, // switch to http if your site uses it
          hostingWPCOM: false, // this is critical for self-hosted WP (not WP.com)
          useACF: false, // set to true only if you're using Advanced Custom Fields
        },
      },
    ]
    

    If your WordPress is running locally, double-check that your local server (MAMP/XAMPP, etc.) is up and running, and that Gatsby can reach the WP URL without issues.

  • Confirm the WordPress REST API is accessible
    The gatsby-source-wordpress plugin relies on WordPress's REST API to pull data. Open your browser and visit your-wp-site-url/wp-json—you should see a large JSON response. If you get a 404 or error:

    • Switch to a default WordPress theme (like Twenty Twenty-One) to rule out theme conflicts
    • Disable all third-party plugins on your WordPress site, as some might block the REST API
  • Check version compatibility
    Your Gatsby version (1.1.39) is quite outdated, and newer versions of gatsby-source-wordpress may not support it. Try installing a plugin version that's compatible with Gatsby 1.x, for example:

    npm install gatsby-source-wordpress@3.x
    

    Also, Node v8.9.4 is end-of-life—while it might work, upgrading to Node 12+ could resolve hidden compatibility issues down the line.

  • Clear Gatsby's cache and rebuild
    Cached data can sometimes cause unexpected behavior. Run these commands in order:

    gatsby clean
    gatsby develop
    

    This will wipe old cached data and force Gatsby to fresh fetch data from WordPress.

  • Enable verbose logging for more clues
    Run your develop command with the verbose flag to see detailed plugin logs:

    gatsby develop --verbose
    

    Look for error messages related to connecting to WordPress, authentication issues, or missing endpoints—this can point you directly to the root cause.

Following these steps should help you resolve the node generation issue. Start with the configuration and REST API checks, as those are the most common culprits!

内容的提问来源于stack exchange,提问作者ThierryBC

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 07:28:00