TanStack

T

TanStack

TanStack is a community of passionate software engineers striving for high-quality, open-source software for web devs

Join

react-query-questions

solid-query-questions

table-questions

virtual-questions

router-questions

react-charts-questions

ranger-questions

vue-query-questions

svelte-query-questions

bling-questions

form-questions

angular-query-questions

start-questions

db-questions

start-showcase

router-showcase

📣-announcements

other-emerald
other-emerald11/11/2025

Adding authentication leads to performance issues and unneccessary api calls

In my src/routes/(protected)/admin/route.tsx layout file, I call ``` export const Route = createFileRoute("/(protected)/admin")({ beforeLoad: async () => {...
ratty-blush
ratty-blush11/11/2025

Wrong type inference from beforeLoad/loader when using complex objects in return

I've added all the necessary types and declarations, started the fresh new project. I want to prefetch the product from an api and i have all the necessary types infered. Here's an example of the code: ```tsx...
stormy-gold
stormy-gold11/11/2025

useRouteContext is not waiting for `beforeLoad` function

I have a problem in solid: ```ts export const Route = createFileRoute("/_spa/_authenticated")({ component: AuthLayout,...
blank-aquamarine
blank-aquamarine11/10/2025

Loader types vs Route.useLoaderData() not matching

```ts export const Route = createFileRoute("/_authed")({ beforeLoad: async () => { const { userId } = await checkAuthFn(); ...
No description
hilarious-sapphire
hilarious-sapphire11/10/2025

Bulk prefetching

Hello, I’m using tanstack start, router and query to build a pretty simple app. My app has primary content, lets say blogposts, and secondary content, lets say comments. In my route’s loader function I prefetch the posts and await them (context.queryclient.ensurequerydata). Using the posts, I prefetch the comments (in bulk) and seed the data for comments on singular posts. I do not await this call, as it’s secondary data. I render my page with posts, and with each post a chip that displays the amount of comments wrapped in a suspense. The chip component has a suspensequery in it to fetch the amount of comments for that particular post. ...
fair-rose
fair-rose11/10/2025

Deploy on cloudflare always returns 500

I have an app which runs a absolutely fine locally. No issue whatsoever. Then when I deploy it to cloudflare it is just returning 500 and prints absolutely no log. https://hraj-eu.capaj.workers.dev/ here you can see all I get...
correct-apricot
correct-apricot11/10/2025

Accessing returned middleware data in router context

I have some middleware that returns some additional context like so: ``` export const exampleMiddleware = createMiddleware().server(async ({ next }) => { return next({ context: { foo: "bar" } })...
other-emerald
other-emerald11/10/2025

Issues with `throw redirect()`

I have a login form and server function: ``` src/components/forms/AdminLoginForm export function AdminLoginForm() {...
stormy-gold
stormy-gold11/10/2025

Hydration fails silently ?

Hi, I'm trying out the latest tanstack start and I'm facing a weird issue. My route is defined like this: ...
wise-white
wise-white11/10/2025

Prerender not working when using TanStack Start with Nitro v2 plugin

Hi, I’m trying to prerender pages using tanstack-start + Nitro v2 plugin, but prerendering doesn’t generate any static output. Here’s my vite.config.ts: ```typescript // vite.config.ts...
other-emerald
other-emerald11/9/2025

Questions about TanStack Start integration and context handling

Hello! I have a few questions about TanStack Start. 1) Does it already come with Tanstack Query, or do I need to install it separately? 2) Is it already possible to integrate it with TanStack DB + ElectricSQL, or not yet? Also, does TanStack DB replace Drizzle?...
afraid-scarlet
afraid-scarlet11/8/2025

this route with search params cause the whole app to break

I am new to Tanstack start and Convex, the route causes the app to fail, any idea how to fix it?
No description
wise-white
wise-white11/8/2025

How can we get control over how the output is bundled?

Hey all, The bundles that are generated for my project end up being pretty nasty. The CSS isn't being combined together in a sensible way, and each route is generating tiny js imports that would be better off being part of the primary bundle. I've tried configuring rollup, but it crashes.. I'm guessing start is injecting something that rollup doesn't understand...?...
rival-black
rival-black11/8/2025

llms.txt

is llms.txt for Tanstack START available?
jolly-crimson
jolly-crimson11/7/2025

TypeScript Type Inference Issue with createServerFn and Connect RPC

I'm experiencing a TypeScript type inference issue when using createServerFn().handler() with a Connect RPC function that returns a discriminated union response type. TypeScript recursively infers the entire getCurrentUser response structure, deeply expanding all nested Protobuf message types within the discriminated union. This results in a massive inferred type that: - Is not assignable to UserAccountDetails, causing a type error...
No description
adverse-sapphire
adverse-sapphire11/7/2025

No `server` prop for `createFileRoute`

Hey everyone! I'm running into a strange issue. I have been using tanstack for about half a year now, mostly creating simple routes, but now I need to create an API route. Everything works well except for the fact that typescript is complaining that theres no server for createFileRoute. The api works fine - I can call it and it returns the response, its just typescript that is complaining. I am clueless why. Does anyone have any idea what to check? This is the toolkit I'm using: pnpm@10.13.1, react@19.2, clerk auth, prisma orm plus some other, non relevant libraries ...
No description
sensitive-blue
sensitive-blue11/7/2025

Integration with MSW

Has anyone integrated MSW with a TanStack Start app successfully for mocking server functions? I guess I could build the URLs that are created from the server functions for the MSW handlers, but that would probably be flaky. Also, with the new serializer used in server functions, returning a mock response properly will be a real pain. Maybe there's a better way? Thanks!
like-gold
like-gold11/7/2025

tanstack start compression setup with nitro

I try to setup react start with nitrov2 and I want to compress with gzip. This is my vite.config.ts: ```export default defineConfig({ plugins: [ tsConfigPaths(), tanstackStart(),...
optimistic-gold
optimistic-gold11/7/2025

customErrorAdapter

I have this errors.ts which i want to create my own custom errors, but where do i put my customErrorAdapter? import { createSerializationAdapter } from "@tanstack/react-router" export class NotMemberError extends Error {...
adverse-sapphire
adverse-sapphire11/7/2025

How to currently access request headers?

I see some old suggestions linking to a page in server functions that no longer exists. https://tanstack.com/start/latest/docs/framework/react/server-functions#accessing-the-request-context SSR is causing issues with better-auth and i was attempting to create an isomorphic function that would correctly fetch the user's session like so: ...