Skip to content
Discussion options

You must be logged in to vote

Hi!

We'll need a minimal reproduction for this. However, I have an idea what it might be:

https://www.gatsbyjs.com/docs/node-creation/#freshstale-nodes

Any nodes that aren’t touched by the end of the source-nodes phase, are deleted. This is performed via a diff between the nodesTouched and nodes Redux namespaces, in source-nodes.ts

On your first run without a cache all nodes are "fresh" so they are all created. But on further runs your newly created nodes inside onCreateNode are probably not "touched" and thus garbage collected.
This can happen when you e.g. don't set the parent when it's necessary.

The source plugin tutorial also touches (heh) on this API:
https://www.gatsbyjs.com/docs…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by LekoArts
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #29304 on February 10, 2021 12:36.