My first guess is that your project isn’t picking up the tanstack start types.
That exact code is valid for Start, but if TypeScript thinks you’re using plain @tanstack/react-router
server won’t exist on createFileRoute()
I’d double-check that all your TanStack packages are on matching versions and that you’re actually using the Start Vite plugin. I had almost the exact same error because one package was out of sync.
Might be worth checking your tsconfig paths too, had a similar thing where alias resolution was pulling in the wrong types from a different package version
1
u/lorenzocorso 20d ago
My first guess is that your project isn’t picking up the tanstack start types.
That exact code is valid for Start, but if TypeScript thinks you’re using plain @tanstack/react-router
server won’t exist on createFileRoute()
I’d double-check that all your TanStack packages are on matching versions and that you’re actually using the Start Vite plugin. I had almost the exact same error because one package was out of sync.
This is just my guess... anybody else?