Skip to content

fix: Prevent trailing slash in example paths - #1197

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/example-path-trailing-slash
Open

fix: Prevent trailing slash in example paths#1197
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/example-path-trailing-slash

Conversation

@sentry

@sentry sentry Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

This PR fixes an issue where navigating to an example index page (e.g., /query/latest/docs/framework/vue/examples) would result in a validation error. The params._splat parameter is empty in such cases, and the previous logic [framework, params._splat].join('/') would produce a path with a trailing slash (e.g., vue/). This trailing slash was then included in repoStartingDirPath (e.g., examples/vue/), causing isValidRepoPath to fail.

The fix involves adding .filter(Boolean) to the array before joining the path segments, ensuring that empty strings (from an empty _splat) are removed. This prevents the generation of trailing slashes in the examplePath and repoStartingDirPath, resolving the validation error.

Changes made in src/routes/_library/$libraryId/$version.docs.framework.$framework.examples.$.tsx:

  • Updated [framework, params._splat].join('/') to [framework, params._splat].filter(Boolean).join('/') in three locations to correctly construct examplePath without trailing slashes when _splat is empty.

Fixes TANSTACK-COM-1C5

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com 5f8a238 Commit Preview URL

Branch Preview URL
Aug 30 2026, 11:05 AM

@tannerlinsley tannerlinsley added the source-audit Tracked by the automated source audit label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source-audit Tracked by the automated source audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant