React / Gatsby / Wordpress卡在“源和转换节点”上

时间:2018-11-01 18:36:38

标签: wordpress reactjs gatsby

我知道已经有几个问题了,但是大多数问题看起来都是封闭的或过时的...

我们在本地有一个React / Gatsby网站,该网站从WPEngine托管的产品WP中提取博客文章和媒体。昨天仍然可以正常运行,当调用 gatsby development 时,它将在大约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项目的configs或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"

感谢您的任何输入!

2 个答案:

答案 0 :(得分:1)

尝试调整终端的大小。我知道...很奇怪,但对大多数人来说,这就是解决方法。 -参见此处https://github.com/gatsbyjs/gatsby/issues/4666

答案 1 :(得分:0)

有人向我建议这是节点的内存问题。我将以下内容放入终端,它为我解决了问题:

export NODE_OPTIONS=--max_old_space_size=4096