fix(site): generate /docs paths from .md files, retry 404s via ISR#3825
Merged
Conversation
getStaticPaths was sourcing the pre-render list from the WordPress
Primary Nav menu (only 4 URIs of ~50 docs), and getStaticProps returned
bare { notFound: true } with no revalidate. Any transient build-time
fetch failure for those 4 menu-linked docs got cached as a permanent
static 404 — ISR could never retry. /docs/intro-to-graphql and
/docs/posts-and-pages were stuck this way.
Switch getStaticPaths to enumerate paths from the actual .md files in
plugins/wp-graphql/docs/ (via getAllDocUri), and add revalidate to the
notFound return so transient failures self-heal.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
src/pages/docs/[slug].jsgetStaticPathswas sourcing the pre-render list from the WordPress Primary Nav menu (only ~4 URIs out of ~50 docs), andgetStaticPropsreturned bare{ notFound: true }with norevalidate. Any transient build-time fetch failure for those 4 menu-linked docs got cached as a permanent static 404 — ISR could never retry./docs/intro-to-graphqland/docs/posts-and-pagesare stuck this way on production (both URIs from the WP nav menu). The other ~46 docs all serve viafallback: "blocking"and work fine.getStaticPathsto enumerate paths from the actual.mdfiles inplugins/wp-graphql/docs/via the existinggetAllDocUri()helper, and addrevalidate: 30to thenotFoundbranch so transient failures self-heal.Test plan
/docs/intro-to-graphqlreturns 200 after deploy/docs/posts-and-pagesreturns 200 after deploy/docs/introduction,/docs/custom-post-types,/docs/connections) still serve correctly/docs/introductionall resolve to 200