Skip to content
Source
Sign inSign up
TanStack/router

[BREAKING] 1.131.37 route params are not of promised type #5123

Send to my agent
ClosedArthurdw(GitHub profile, opens in a new tab) opened this issue 1 comment

Which project does this relate to?

Router

Describe the bug

Route parameters are now automatically parsed as integers at runtime, but TypeScript still types them as strings, causing type mismatches and potential runtime errors.

Probably related to changes made in: https://github.com/TanStack/router/pull/5120

Your Example Website or App

https://stackblitz.com/edit/github-cr3hcvtf

Steps to Reproduce the Bug or Issue

Have any int params

Expected behavior

The parse should be passed a string

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.131.37
  • OS: Linux
  • Bundler: vite
  • Bundler Version: vite/7.1.5

Additional context

No response

  1. to be clear, this is about the runtime type of sample being passed into params.parse

    it alternates between string and number

    params: {
        parse: ({ sample }) => {
          console.log(typeof sample);
          return { sample: parseInt(sample) };
        },
      },

Sign in to join this conversation.