fix(gatsby): add retry mechanism for gatsby-node/config.ts compilation #35974
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Sometimes Parcel (cache?) gets in a weird state where it doesn't output compiled files anymore, but the compilation itself doesn't report any errors (?).
This adds validation checks and retry mechanism in case we hit that problem.
Some notes / thoughts:
We do remove any compiled files from our output dir before running Parcel ( to get rid of potentially stale files from previous builds ) - can this be a factor in this behaviour we are seeing? It works most of the time, so it would seem like it's not a complete "no-no", but might be part of why this happens, sometimes.
We could instead maybe remove files that were not bundled in current run, but then it would mean that we potentially might use stale compiled files if there are other reasons for Parcel not outputting those files 🤷
Documentation
Related Issues
[ch51776]
[ch51597]