Skip to content

Tanstack start + nitro (with basePath) infinite redirect for url parameter with dots #6903

Closed
nitrojs/nitro
#4108

Description

@Julienng

Which project does this relate to?

Start

Describe the bug

Hi,

I'm facing an infinite redirect in Dev and Prod for a specific config of Tanstack Start + Nitro.

The problem occurs when:

  • A splat route is used as a proxy, and the URL looks like this: /subdir/api/proxy/todos/Package.todos.Entity.1
  • Vite config is setting a basePath

The config:

const config = defineConfig({
  base: "/subdir",
  plugins: [
    devtools(),
    nitro({ baseURL: "/subdir" }),
    tsconfigPaths({ projects: ["./tsconfig.json"] }),
    tailwindcss(),
    tanstackStart(),
    viteReact(),
  ],
});

Your Example Website or App

https://github.com/Julienng/tanstack-nitro-basepath-id-with-dots-reproduction-bug

Steps to Reproduce the Bug or Issue

  1. Go to the index page: http://localhost:3000/subdir/
  2. Choose one of the 3 detail pages and open
  3. An infinite redirect occurs, and the error page is shown
  4. Refresh browser -> the page is shown properly (the page and resource are accessible, but proxy from frontend is bugged)

Expected behavior

The call to /api/proxy/$ should not do an infinite redirect

Screenshots or Videos

Screen.Recording.2026-03-12.at.13.46.33.mov

Platform

  • Router Start Version: latest (setted by cli)
  • Nitro: 3.0.260311-beta (problem is present in alpha too)
  • OS: Macos 26.2
  • Browser: Chrome
  • Browser Version: 144.0.7559.133
  • Bundler: vite
  • Bundler Version: ^7.3.1

Additional context

When Nitro is disabled, Tanstack routing is resolving the route correctly

Activity

  1. schiller-manuel commented on Mar 26, 2026

    @schiller-manuel
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions