Skip to content

fix(docs): Allow square brackets in repo paths for dynamic routes - #1273

Open
sentry[bot] wants to merge 2 commits into
mainfrom
seer/fix/repo-path-brackets
Open

sentry[bot] wants to merge 2 commits into
mainfrom
seer/fix/repo-path-brackets

Conversation

@sentry

@sentry sentry Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

This PR addresses an issue where SvelteKit and Next.js dynamic route filenames, which use square brackets (e.g., [postId]), were being rejected by the isValidRepoPath validation.

The REPO_PATH_SEGMENT_PATTERN regex in src/utils/repo-path.ts did not include [ or ], leading to a validation error when the example viewer attempted to load source files like examples/svelte/ssr/src/routes/[postId]/+page.svelte.

Changes Made:

  • Updated REPO_PATH_SEGMENT_PATTERN in src/utils/repo-path.ts to include [ and ] characters.
  • Added a new test case in tests/repo-path.test.ts to specifically validate paths containing square-bracket segments, ensuring the fix works as expected and preventing regressions.

This change is safe as existing path traversal defenses remain intact, and it aligns with the precedent of allowing other special characters like $ in repo paths.

Fixes TANSTACK-COM-2Q9

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 14, 2026

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 7f96347 Commit Preview URL

Branch Preview URL
Sep 14 2026, 11:05 PM

@coderabbitai

coderabbitai Bot commented Sep 14, 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: 99ef4dd9-5a09-4f21-a168-097c58fb5352

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.

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