Skip to content

fix(docs): Prevent examples index page crash - #1292

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/examples-index-crash
Open

sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/examples-index-crash

Conversation

@sentry

@sentry sentry Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

When navigating to an examples index page (e.g., /table/latest/docs/framework/react/examples) without a specific example slug, params._splat is undefined.

Previously, this would cause [framework, params._splat].join('/') to produce a path with a trailing slash (e.g., react/). This malformed path was then rejected by isValidRepoPath during validation, leading to a page crash.

This fix addresses the issue by:

  1. In the loader (src/routes/_library/$libraryId/$version.docs.framework.$framework.examples.$.tsx), explicitly checking for an undefined params._splat and throwing notFound() early. This prevents the construction of an invalid repoStartingDirPath and ensures a graceful 404 for index pages.
  2. Applying a guard to the examplePath construction in two other locations within the same file (lines 352 and 613) to ensure that if _splat is ever undefined in those contexts, a trailing slash is not inadvertently created. This provides additional robustness.

Fixes TANSTACK-COM-545

@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 23, 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: 644d0ce7-350d-45f3-9f26-f73a7699d62b

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 61c00a2 Commit Preview URL

Branch Preview URL
Sep 23 2026, 11:05 PM

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