fix(errors): correct param key in getStaticPaths error-doc examples (slug → id)#16976
Merged
ematipico merged 1 commit intoJun 5, 2026
Merged
Conversation
…atch [id].astro route
|
matthewp
pushed a commit
that referenced
this pull request
Jun 8, 2026
* fix(errors): correct param key in getStaticPaths error-doc examples (slug → id) (#16976) * fix(cloudflare): defer createApp/setGetEnv in fetch.ts to avoid circular import crash (#16956) (#16968) * fix(fetch): sync request.url with forwarded headers in FetchState (#16947) * fix(fetch): sync request.url with forwarded headers in FetchState (#16945) * chore: improve tests and solution --------- Co-authored-by: astrobot-houston <fred+astrobot@astro.build> * chore: avoid an unwanted mdx major bump (#16977) * chore(renovate): bump max memory (#16993) --------- Co-authored-by: Minh Lê <115204145+DucMinhNe@users.noreply.github.com> Co-authored-by: Houston (Bot) <108291165+astrobot-houston@users.noreply.github.com> Co-authored-by: Emanuele Stoppa <estoppa@cloudflare.com> Co-authored-by: astrobot-houston <fred+astrobot@astro.build> Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
florian-lefebvre
added a commit
that referenced
this pull request
Jun 8, 2026
Co-authored-by: astrobot-houston <fred+astrobot@astro.build> Co-authored-by: Minh Lê <115204145+DucMinhNe@users.noreply.github.com> Co-authored-by: Houston (Bot) <108291165+astrobot-houston@users.noreply.github.com> Co-authored-by: Emanuele Stoppa <estoppa@cloudflare.com> Co-authored-by: ocavue <ocavue@users.noreply.github.com> fix(errors): correct param key in getStaticPaths error-doc examples (slug → id) (#16976) fix(cloudflare): defer createApp/setGetEnv in fetch.ts to avoid circular import crash (#16956) (#16968) fix(fetch): sync request.url with forwarded headers in FetchState (#16947) fix(fetch): sync request.url with forwarded headers in FetchState (#16945)
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
Three JSDoc example blocks in
errors-data.ts— forInvalidGetStaticPathParam,InvalidGetStaticPathsEntry, andInvalidGetStaticPathsReturn— open with the route filepages/blog/[id].astrobut then return params keyed onslug:For a dynamic route
[id].astro,getStaticPaths()must return params keyed on the segment nameid. Aslugkey would itself trigger a routing error, so these examples — whose whole purpose is to teach correctgetStaticPaths()usage — are internally inconsistent.These JSDoc blocks also generate the public Error Reference pages, so the mismatch is user-facing (e.g.
docs.astro.build/en/reference/errors/invalid-get-static-path-param/).Change
Replace the
slugparam key withidin all six lines so each example matches its declared[id].astroroute. This matches the neighboring blocksGetStaticPathsExpectedParamsandGetStaticPathsInvalidRouteParam, which already use{ params: { id: ... } }for an[id]route.Docs/comment example only — no runtime code changes.