TanStack / TanStack/router

`validateSearch` prevents masking URL

Open
#3,575 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.1k
Forks
1.9k
Avg merge
1d 20h
Merged PRs (30d)
143

Description

Which project does this relate to?

Router

Describe the bug

When you return default values from validateSearch option, Masking URL does not work anymore.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-xqyz7u5c

Steps to Reproduce the Bug or Issue
  1. open Stackblitz
  2. open Browser window in a new tab as you can't see url changes inside Stackblitz
  3. click 'to redirect page' link
  4. url has its search params like about?redirect=%2F even though masking URL in redirect.tsx exists
  5. once you remove validateSearch in about.tsx this problem disappears
Expected behavior

Masking URL works with validateSearch default values.

Screenshots or Videos

No response

Platform
  • OS: macOS
  • Browser: Chrome
  • Version: 133.0.6943.128
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproduction, focusing on redirect.tsx and about.tsx and the validateSearch and masking URL options described in the steps. Compare the URL after clicking the redirect link with and without validateSearch; done means default search values no longer prevent the masked URL from appearing.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.