Skip to content

fix: Prevent trailing slash in example paths - #1311

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

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

Conversation

@sentry

@sentry sentry Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

This PR fixes an issue where navigating to an examples index page (e.g., /docs/react-query/latest/framework/react/examples) would result in a validation error.

The root cause was that when the _splat parameter was empty (meaning no specific example was selected), the [framework, params._splat].join('/') expression would produce a trailing slash (e.g., react/). This trailing slash caused the isValidRepoPath valibot validation to fail, leading to an unhandled error.

The fix involves adding .filter(Boolean) before .join('/') at all three affected locations in src/routes/_library/$libraryId/$version.docs.framework.$framework.examples.$.tsx. This ensures that empty segments (like an empty _splat) are removed before joining, preventing the creation of a trailing slash and allowing the path to pass validation.

Fixes TANSTACK-COM-1C5

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

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

@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: bcfdbd1a-e3ce-4d9d-977e-096d401ebc29

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@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 3254ef1 Commit Preview URL

Branch Preview URL
Sep 30 2026, 11:06 AM

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants