Skip to content

Start: default search params not working properly with base paths configured #5477

@andybons

Description

@andybons

Which project does this relate to?

Start

Describe the bug

I’m seeing some weirdness when a base path is configured with an app that has default search parameters via a zod schema.

Your Example Website or App

https://codesandbox.io/p/devbox/composed-middleware-typing-issue-1-132-7-forked-85dx8w

Steps to Reproduce the Bug or Issue

  1. Visit repro url
  2. Manually type in https://85dx8w-5173.csb.app/base/foo and press return to trigger load of /foo page
  3. Observe it does not match the /foo route and shows a vite suggestion to visit /foo?search=query instead
  4. Click on the link and observe the url doesn’t change, but the search params are populated and the page renders
  5. Hit the reload button and see it redirect back to /base

Note: this happens in spa mode and regular mode

Expected behavior

I expect that visiting /base/foo should redirect me to the default search params specified by the schema (/base/foo?search=query)

Screenshots or Videos

Repro
Clipboard-20251014-161022-738.mp4

Platform

  • Router / Start Version: Start: 1.132.56; router: 1.132.47
  • OS: macOS
  • Browser: Chrome
  • Bundler: vite
  • Bundler Version: v7.1.10

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions