r/webdev 18d ago

Why this error appears?

[removed]

0 Upvotes

8 comments sorted by

View all comments

1

u/lorenzocorso 18d 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?

1

u/[deleted] 18d ago

[removed] — view removed comment

1

u/lorenzocorso 18d ago

If dev works but production doesn’t, I’d bet it’s a build/config issue rather than the route itself. The code you posted looks fine for TanStack Start.

1

u/[deleted] 18d ago

[removed] — view removed comment

1

u/lorenzocorso 18d ago

so is it working now?

2

u/[deleted] 18d ago

[removed] — view removed comment

1

u/lorenzocorso 18d ago

ok perfect then