T
TanStack3mo ago
robust-apricot

Cannot find module '@tanstack/react-start/api'

I am on version 1.121.0 i and am trying to migrate ti vite by using the official github guide provided here: https://github.com/TanStack/router/discussions/2863 And i am getting this error: "@tanstack/react-start": "1.121.0",
GitHub
Start BETA - Tracking · TanStack router · Discussion #2863
Tracking any important changes for TanStack Start during the BETA period. If you are coming from the ALPHA of TanStack Start, you can see all the breaking changes that were made here - #2403
No description
6 Replies
like-gold
like-gold3mo ago
I believe on the new version you dont need to import anything, just the function would be enough. Ex:
import { auth } from '@/services/auth/auth.better-auth'

export const ServerRoute = createServerFileRoute().methods({
GET: ({ request }) => {
return auth.handler(request)
},
POST: ({ request }) => {
return auth.handler(request)
},
})
import { auth } from '@/services/auth/auth.better-auth'

export const ServerRoute = createServerFileRoute().methods({
GET: ({ request }) => {
return auth.handler(request)
},
POST: ({ request }) => {
return auth.handler(request)
},
})
robust-apricot
robust-apricotOP3mo ago
@nikus Interesting... i am still getting some undefined error. I will double check if my config are set correctly. You are not on @alpha are you?
like-gold
like-gold3mo ago
yes, this is the alpha.
robust-apricot
robust-apricotOP3mo ago
Just installed Alpha, still having error: 'createServerFileRoute' is not defined.eslintno-undef ⌘+click to open in new tab Cannot find name 'createServerFileRoute'.ts(2304) Here is my package.json:
No description
like-gold
like-gold3mo ago
Did you run the dev server ? This should be infered from the router generator i believe.
robust-apricot
robust-apricotOP3mo ago
oooooh, thanks a lot! Did not know that we had to run the dev server.... Thanks! Issue resolved

Did you find this page helpful?