【问题标题】:ETIMEDOUT error in plugin gatsby-source-wordpress插件 gatsby-source-wordpress 中的 ETIMEDOUT 错误
【发布时间】:2021-03-24 07:13:24
【问题描述】:

该网站是使用 Gatsby.JS 作为表示层和无头 WordPress 作为博客条目的存储库创建的。

WP Github Trigger 插件用于在 WordPress 中添加条目后重建页面,在保存帖子时向 Github 发送通知,并激活构建项目并将其发送到网站服务器的过程。

当我开始 GitHub 操作时,我得到了日志:

error  gatsby-source-wordpress  connect ETIMEDOUT xx.xx.xx.xx:80 

GraphQL request to http://example.com/graphql failed.

Please ensure the following statements are true 
  - your WordPress URL is correct in gatsby-config.js
  - your server is responding to requests 
  - WPGraphQL and WPGatsby are installed in your WordPress backend
not finished createSchemaCustomization - 260.923s

我的 gatsby-config.js 文件:

const isDev = process.env.NODE_ENV === `development`;

require('dotenv').config({
  path: `.env.${isDev ? 'development' : 'production'}`,
});


module.exports = {
  siteMetadata: {
    title: `xxx`,
    description: `xxx`,
    author: `xxx`,
    client: {
      fullName: 'xxx',
      profession: 'xxx',
      telephone: 'xxx',
      email: 'xxxx',
      address: {
        street: 'xxxx',
        city: 'xxx',
      },
    },
  },
  plugins: [
    `gatsby-plugin-react-helmet`,
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `images`,
        path: `${__dirname}/src/images`,
      },
    },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-sharp`,
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `gatsby-starter-default`,
        short_name: `starter`,
        start_url: `/`,
        background_color: `#012501`,
        theme_color: `#012501`,
        display: `minimal-ui`,
        icon: `src/images/favicon-32x32.png`, 
      },
    },
    {
      resolve: 'gatsby-source-wordpress-experimental',
      options: {
        url: process.env.WPGRAPHQL_URL, // this URL is correct (xxx.com/graphql endpoint)
        schema: {
          typePrefix: `Wp`,
        },
        develop: {
          hardCacheMediaFiles: true,
        },
        type: {
          Post: {
            limit: isDev ? 50 : 5000,
          },
        },
      },
    },
    {
      resolve: 'gatsby-plugin-react-svg',
      options: {
        rule: {
          include: /images/,
        },
      },
    },
    {
      resolve: `gatsby-plugin-styled-components`,
      options: isDev ? { displayName: true } : undefined,
    },
    {
      resolve: `gatsby-plugin-scroll-reveal`,
      options: {
        threshold: 0.001, 
        once: true, 
        disable: false, 
        selector: '[data-sal]', 
        rootMargin: '0% 10%', 

      },
    },
  ],
};

这是我使用 Gatsby 创建的第一个网站(这就是我为之服务的人的需要)。

一开始我以为是ip访问的问题,虽然被加到了白名单里,但还是没用。

您知道导致错误的原因吗?

【问题讨论】:

    标签: wordpress graphql gatsby


    【解决方案1】:

    您可以在package.json 中将您的开发运行命令更改为:

    "develop": "GATSBY_CONCURRENT_DOWNLOAD=5 gatsby develop",
    

    这应该可以解决问题。

    【讨论】:

    • 还是同样的问题 :(
    猜你喜欢
    • 2019-12-10
    • 2021-01-10
    • 2021-05-08
    • 2020-08-11
    • 2019-11-14
    • 2018-07-21
    • 2021-06-11
    • 2021-01-13
    • 2020-12-18
    相关资源
    最近更新 更多