TanStackT
TanStack4mo ago
9 replies
colossal-harlequin

Server Routes / Functions not working properly

Hi, I'm having an issue with using serverOnly() and createServerFileRoute.
I've been using them for awhile in my codebase, but suddently after updating, errors are being thrown at me saying serverOnly doesn't exist, or createServerFileRoute doesn't exist. This worked error free not even 2 days ago, but now I can't get it to even spin up in a dev environment because all my server API routes are using that (I'm using the tanstack starter template with better auth / vite).
Also getting a ton of route piece errors for ALL api routes, but never got them before.
New to ts development so not sure what I'm doing wrong.
I asked chatgpt but it said to define my routes with GET POST or something like that, but i alredy have, for example
export const ServerRoute = createServerFileRoute("/api/signup/approved/$").methods({ POST: async ({ request }: { request: Request }) => {
Was this page helpful?