router icon indicating copy to clipboard operation
router copied to clipboard

Can't use ValidateLinkOptions inside createFileRoute

Open JuanM04 opened this issue 1 month ago • 0 comments

Which project does this relate to?

Router

Describe the bug

When trying to use the type ValidateLinkOptions or similar (like LinkProps) inside the loader of createFileRoute, I get the error

'loader' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.

This seems like a regression, because it worked fine in v1.130.12.

Your Example Website or App

https://stackblitz.com/edit/github-mbsacxwx?file=src%2Froutes%2Findex.tsx

Steps to Reproduce the Bug or Issue

Return something typed as ValidateLinkOptions inside a loader. You must have a route that accepts parameters, like /user/$userId.

Expected behavior

This shouldn't happen, as the return type of a loader shouldn't be related to the route names.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.136.14
  • OS: Linux
  • Browser: N/A
  • Browser Version: N/A
  • Bundler: rolldown-vite
  • Bundler Version: 7.2.5

Additional context

I using this to declare breadcrumbs, maybe this particular problem can be solved in another way

JuanM04 avatar Nov 19 '25 17:11 JuanM04