allMarkdownRemark
graphql query in createPages
intermittently hangs when excerpt
or timeToRead
fields are included
#38855
Labels
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
type: bug
An issue or pull request relating to a bug in Gatsby
Preliminary Checks
Description
We use gatsby for our blog and have about 650 markdown files. We use the
gatsby-transformer-remark
plugin. This graphql query increatePages
often hangs when runninggatsby build
orgatsby develop
. It never completes, errors, or gives any useful information about what went wrong. This is not a recent issue for us and has been around since at least Gatsby v4, maybe earlier. When it does complete,createPages
takes about 90s.These are the
gatsby build --verbose
logs where it hangs:This step never moves past 0% or errors. The logs look similar for
gatsby develop
, but without the lastRunning gatsby-plugin-sharp.IMAGE_PROCESSING jobs
line.I recently discovered that removing the
excerpt
andtimeToRead
fields fixes the hanging problem and reducescreatePages
to <1s. If I add a limit of up to 300 onallMarkdownRemark
, it also doesn't hang. This is reproducible using the gatsby cli on my local computer and in github actions.Is there a better way to debug why this query is hanging when we include fields that require parsing our markdown files?
It is difficult to reproduce without our repository, which is private. But here are our gatsby config and package.json.
This is our
package.json
:And our
gatsby.config
:And a simplified version of our
gatsby-node
that still reproduces the issue:Reproduction Link
N/A
Steps to Reproduce
allMarkdownRemark
query increatePages
withexcerpt
and/ortimeToRead
fieldsgatsby build
orgatsby develop
createPages
...
Expected Result
Build is successful or errors
Actual Result
Build hangs indefinitely
Environment
System: OS: macOS 14.1 CPU: (12) arm64 Apple M3 Pro Shell: 5.9 - /bin/zsh Binaries: Node: 20.11.1 - /private/var/folders/2f/47svy2p51k12pmjv4phs06k00000gn/T/xfs-804f9c02/node Yarn: 4.0.2 - /private/var/folders/2f/47svy2p51k12pmjv4phs06k00000gn/T/xfs-804f9c02/yarn npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm Languages: Python: 3.9.2 - /Users/taylor/.pyenv/shims/python Browsers: Chrome: 121.0.6167.184 Safari: 17.1
Config Flags
None
The text was updated successfully, but these errors were encountered: