首页 > 解决方案 > React/Gatsby/Wordpress 卡在“源和转换节点”上

问题描述

我知道已经有几个这样的问题,但其中大多数看起来已经关闭或过时了......

我们在本地有一个 React/Gatsby 站点,它从我们托管在 WPEngine 上的 prod WP 中提取博客文章和媒体。昨天仍然运行良好,当调用gatsby develop时,它会在大约 2 分钟内启动本地服务器。今天,显然没有任何理由,它给了我们以下信息:

C:\www\my_react_project>gatsby develop
success open and validate gatsby-config - 0.004 s
success load plugins - 0.195 s
success onPreInit - 0.605 s
success delete html and css files from previous builds - 0.368 s
success initialize cache - 3.565 s
success copy gatsby files - 0.267 s
success onPreBootstrap - 0.008 s
? source and transform nodes
=START PLUGIN=====================================

Site URL: https://somecorpsite.com
Site hosted on Wordpress.com: false
Using ACF: false
Using Auth: undefined undefined
Verbose output: true

Mama Route URL: https://somecorpsite.com/wp-json

? source and transform nodesRoute discovered : /
Invalid route.
Route discovered : /wp/v2
Invalid route.
Route discovered : /wp/v2/posts
Valid route found. Will try to fetch.
Route discovered : /wp/v2/posts/(?P<id>[\d]+)
Invalid route.
Route discovered : /wp/v2/posts/(?P<parent>[\d]+)/revisions
Invalid route.
Route discovered : /wp/v2/posts/(?P<parent>[\d]+)/revisions/(?P<id>[\d]+)
Invalid route.
Route discovered : /wp/v2/pages
Excluded route from excludedRoutes pattern.
Route discovered : /wp/v2/pages/(?P<id>[\d]+)
Invalid route.
Route discovered : /wp/v2/pages/(?P<parent>[\d]+)/revisions
Invalid route.
Route discovered : /wp/v2/pages/(?P<parent>[\d]+)/revisions/(?P<id>[\d]+)
Invalid route.
Route discovered : /wp/v2/media
Valid route found. Will try to fetch.
Route discovered : /wp/v2/media/(?P<id>[\d]+)
Invalid route.
Route discovered : /wp/v2/types
Valid route found. Will try to fetch.
Route discovered : /wp/v2/types/(?P<type>[\w-]+)
Invalid route.
Route discovered : /wp/v2/statuses
Valid route found. Will try to fetch.
Route discovered : /wp/v2/statuses/(?P<status>[\w-]+)
Invalid route.
Route discovered : /wp/v2/taxonomies
Valid route found. Will try to fetch.
Route discovered : /wp/v2/taxonomies/(?P<taxonomy>[\w-]+)
Invalid route.
Route discovered : /wp/v2/categories
Valid route found. Will try to fetch.
Route discovered : /wp/v2/categories/(?P<id>[\d]+)
Invalid route.
Route discovered : /wp/v2/tags
Excluded route from excludedRoutes pattern.
Route discovered : /wp/v2/tags/(?P<id>[\d]+)
Invalid route.
Route discovered : /wp/v2/yst_prominent_words
Excluded route from excludedRoutes pattern.
Route discovered : /wp/v2/yst_prominent_words/(?P<id>[\d]+)
Invalid route.
Route discovered : /wp/v2/users
Valid route found. Will try to fetch.
Route discovered : /wp/v2/users/(?P<id>[\d]+)
Invalid route.
Route discovered : /wp/v2/users/me
Excluded route from excludedRoutes pattern.
Route discovered : /wp/v2/comments
Excluded route from excludedRoutes pattern.
Route discovered : /wp/v2/comments/(?P<id>[\d]+)
Invalid route.
Route discovered : /wp/v2/settings
Excluded route from excludedRoutes pattern.
Route discovered : /oembed/1.0
Invalid route.
Route discovered : /oembed/1.0/embed
Invalid route.
Route discovered : /oembed/1.0/proxy
Invalid route.
Route discovered : /yoast/v1
Excluded route from excludedRoutes pattern.
Route discovered : /yoast/v1/configurator
Excluded route from excludedRoutes pattern.
Route discovered : /yoast/v1/reindex_posts
Excluded route from excludedRoutes pattern.
Route discovered : /yoast/v1/ryte
Excluded route from excludedRoutes pattern.
Route discovered : /yoast/v1/indexables/(?P<object_type>.*)/(?P<object_id>\d+)
Invalid route.
Route discovered : /yoast/v1/statistics
Excluded route from excludedRoutes pattern.
Route discovered : /acf/v3
Invalid route.
Route discovered : /acf/v3/posts/(?P<id>[\d]+)/?(?P<field>[\w\-\_]+)?
Invalid route.
Route discovered : /acf/v3/posts
Valid route found. Will try to fetch.
Route discovered : /acf/v3/pages/(?P<id>[\d]+)/?(?P<field>[\w\-\_]+)?
Invalid route.
Route discovered : /acf/v3/pages
Excluded route from excludedRoutes pattern.
Route discovered : /acf/v3/media/(?P<id>[\d]+)/?(?P<field>[\w\-\_]+)?
Invalid route.
Route discovered : /acf/v3/media
Valid route found. Will try to fetch.
Route discovered : /acf/v3/categories/(?P<id>[\d]+)/?(?P<field>[\w\-\_]+)?
Invalid route.
Route discovered : /acf/v3/categories
Excluded route from excludedRoutes pattern.
Route discovered : /acf/v3/tags/(?P<id>[\d]+)/?(?P<field>[\w\-\_]+)?
Invalid route.
Route discovered : /acf/v3/tags
Excluded route from excludedRoutes pattern.
Route discovered : /acf/v3/yst_prominent_words/(?P<id>[\d]+)/?(?P<field>[\w\-\_]+)?
Invalid route.
Route discovered : /acf/v3/yst_prominent_words
Excluded route from excludedRoutes pattern.
Route discovered : /acf/v3/comments/(?P<id>[\d]+)/?(?P<field>[\w\-\_]+)?
Invalid route.
Route discovered : /acf/v3/comments
Excluded route from excludedRoutes pattern.
Route discovered : /acf/v3/options/(?P<id>[\w\-\_]+)/?(?P<field>[\w\-\_]+)?
Invalid route.
Route discovered : /acf/v3/users/(?P<id>[\d]+)/?(?P<field>[\w\-\_]+)?
Invalid route.
Route discovered : /acf/v3/users
Valid route found. Will try to fetch.
Route discovered : /yoast/v1/prominent_words
Excluded route from excludedRoutes pattern.
Route discovered : /yoast/v1/prominent_words_link/(?P<id>[\d]+)
Invalid route.
Route discovered : /yoast/v1/complete_recalculation
Excluded route from excludedRoutes pattern.
Route discovered : /yoast/v1/link_suggestions
Excluded route from excludedRoutes pattern.
Route discovered : /yoast/v1/redirects
Excluded route from excludedRoutes pattern.

Fetching the JSON data from 10 valid API Routes...

=== [ Fetching wordpress__POST ] === https://somecorpsite.com/wp-json/wp/v2/posts
? source and transform nodes
Total entities : 235
Pages to be requested : 3
? source and transform nodes -> wordpress__POST fetched : 235
Fetching the wordpress__POST took: 17352.127ms

=== [ Fetching wordpress__wp_media ] === https://somecorpsite.com/wp-json/wp/v2/media
? source and transform nodes
Total entities : 4638
Pages to be requested : 47
? source and transform nodes -> wordpress__wp_media fetched : 3212
Fetching the wordpress__wp_media took: 73903.345ms

=== [ Fetching wordpress__wp_types ] === https://somecorpsite.com/wp-json/wp/v2/types
? source and transform nodes -> wordpress__wp_types fetched : 1
Fetching the wordpress__wp_types took: 875.090ms

=== [ Fetching wordpress__wp_statuses ] === https://somecorpsite.com/wp-json/wp/v2/statuses
? source and transform nodes -> wordpress__wp_statuses fetched : 1
Fetching the wordpress__wp_statuses took: 852.903ms

=== [ Fetching wordpress__wp_taxonomies ] === https://somecorpsite.com/wp-json/wp/v2/taxonomies
? source and transform nodes -> wordpress__wp_taxonomies fetched : 1
Fetching the wordpress__wp_taxonomies took: 1083.236ms

=== [ Fetching wordpress__CATEGORY ] === https://somecorpsite.com/wp-json/wp/v2/categories
? source and transform nodes -> wordpress__CATEGORY fetched : 9
Fetching the wordpress__CATEGORY took: 1433.496ms

=== [ Fetching wordpress__wp_users ] === https://somecorpsite.com/wp-json/wp/v2/users
? source and transform nodes -> wordpress__wp_users fetched : 14
Fetching the wordpress__wp_users took: 1790.912ms

=== [ Fetching wordpress__acf_posts ] === https://somecorpsite.com/wp-json/acf/v3/posts
? source and transform nodes -> wordpress__acf_posts fetched : 100
Fetching the wordpress__acf_posts took: 5476.182ms

=== [ Fetching wordpress__acf_media ] === https://somecorpsite.com/wp-json/acf/v3/media
? source and transform nodes -> wordpress__acf_media fetched : 95
Fetching the wordpress__acf_media took: 6159.952ms

=== [ Fetching wordpress__acf_users ] === https://somecorpsite.com/wp-json/acf/v3/users
? source and transform nodes -> wordpress__acf_users fetched : 14
Fetching the wordpress__acf_users took: 16257.418ms

=END PLUGIN=====================================: 126446.712ms
? source and transform nodes

...然后它卡在源节点和转换节点上。在杀死它之前,我已经让它尝试做它的事情一个多小时。

据我们所知,我们的 React 项目的配置或 GraphQL 位没有任何变化。今天早上在我们的 WP 网站上发布了一篇新博文,但它怎么能阻止 Gatsby 运行呢?

此外,它在 END OF PLUGINS 之后冻结的事实是否意味着该错误不在 WP 端?那时盖茨比已经完成了从 WP 获取东西,对吗?

正如我所说,我知道以前有人问过类似的问题。但我所看到的答案似乎都不完整或似乎真正解决了我们的情况。

如果有帮助,这是我们的依赖项:

"gatsby": "^2.0.0-rc.0",
"gatsby-cli": "^2.4.3",
"gatsby-image": "next",
"gatsby-paginate": "^1.0.16",
"gatsby-plugin-catch-links": "next",
"gatsby-plugin-google-fonts": "^0.0.4",
"gatsby-plugin-manifest": "next",
"gatsby-plugin-netlify": "next",
"gatsby-plugin-nprogress": "next",
"gatsby-plugin-offline": "next",
"gatsby-plugin-page-transitions": "^1.0.7",
"gatsby-plugin-react-helmet": "next",
"gatsby-plugin-sass": "^2.0.0-beta.6",
"gatsby-plugin-sharp": "next",
"gatsby-plugin-sitemap": "next",
"gatsby-remark-autolink-headers": "next",
"gatsby-source-filesystem": "^2.0.7",
"gatsby-source-hubspot": "^1.0.0",
"gatsby-source-stripe": "latest",
"gatsby-source-wordpress": "^2.0.93",
"gatsby-transformer-remark": "next",
"gatsby-transformer-sharp": "next",
"graphql": "^0.13.2",
"hashmap": "^2.3.0",
"i18n-react": "^0.6.4",
"node-sass": "^4.9.3",
"opentracing": "^0.14.3",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-helmet": "^5.2.0",
"react-hubspot-form": "^1.3.6",
"react-md": "^1.5.0",
"typeface-roboto": "^0.0.54",
"utf8": "^3.0.0",
"yarn": "^1.9.4"

感谢您的任何意见!

标签: wordpressreactjsgatsby

解决方案


尝试调整终端的大小。我知道......这很奇怪,但它是大多数人的解决方案。- 见这里https://github.com/gatsbyjs/gatsby/issues/4666


推荐阅读