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

conscious-sapphire
conscious-sapphire8/27/2025

Tanstack Start with SST

Hey This question might be more relevant for the SST discord, but is anyone using tanstack start with sst/deployed in a lambda? I'm experiencing cold starts of up to 11 seconds which makes the application fairly unusable. A warmer has helped but the cold starts are still occurring occasionally. This is with a fairly small application as well. I am trying to work out what I've done wrong, I'm thinking about moving to ECS instead of deploying via a lambda....
adverse-sapphire
adverse-sapphire8/27/2025

`loaderData` always possibly undefined in the `head` ?

Hello, I see that from the types, the loaderData in the head of a route can always be undefined, but in my test it always returns the value of the loader ? Can we use the data or it can be possibly underfined thus useless ?...
No description
rising-crimson
rising-crimson8/26/2025

CSRF Protection

I'm building an app with Tanstack start + Supabase and thought I'd ask Cursor to do a security audit and it gave CSRF protection ad a critical security issue.
Is there an elegant way of adding CSRF protection into my mutation routes? Or does Tanstack start have a nice built-in way to handle CSRF? Here's an example of how most mutations are created in my app...
eastern-cyan
eastern-cyan8/25/2025

@tanstack/solid-query with tanstack start + ssr

i did not find any equivilant to the @tanstack/react-router-ssr-query package for Solid. how else could i do this as i have gotten stuck thanks in advance and please ping when you reply...
ambitious-aqua
ambitious-aqua8/24/2025

No redirection using throw redirect in middleware

Hello, there is something I don't understand, below is my setup, why the redirect does not work ?? I just get an error on my ErrorCatchBoundary. It is like the error is not handled by the router lifecycle, but I don't understand why.... ```typescript // My dashboard route...
ratty-blush
ratty-blush8/24/2025

Is Tanstack Start good for apps not using tanstack router?

Hi. This is a highly opinionated question but it's be nice to reflect with someone on this Some websites may get all of their routing through a CMS, and my understanding is that to make it work in tanstack start you need to use a catchall/slug route (For example of a CMS https://docs.developers.optimizely.com/content-management-system/v11.0.0-cms/docs/content-tree-and-routing) ...
useful-bronze
useful-bronze8/24/2025

slow hmr

Anyone experiencing slow hmr with tanstack start? I am using content collections to drive content on my website, (content-collections/vite package). I'm wondering if that might be causing the issue.
complex-teal
complex-teal8/24/2025

react-native support?

was curious if anyone had a thought towards sharing router, and server actions in a react-native build as well? in my searching found it really interesting watching the intro video's for https://onestack.dev/ which look to be working towards doing this and vite builds for web and react-native with a heap of different render modes per route. ...
other-emerald
other-emerald8/23/2025

How to remove a client-specific thing from server bundle

I have say a chat app, and want to remove Markdown entirely from my server bundle since it is 1MB+ of JS (react markdown, syntax highlighters, katex, so on) which is polluting my server bundle when absolutely no markdown is actually rendered in SSR... I tried using React.lazy(), but this still includes them in the server bundle output (I'm using cloudflare-module output format)...
fascinating-indigo
fascinating-indigo8/22/2025

Throw `json` in middleware not working for route rendered on server

I have a basic role check in server middleware. In the loaderData function of a Route, it makes a call to a server function using that middleware. However, the server crashes when the route attempts to be loaded by a server without the required role. Any reason why this would be? My middleware: ```TS...
complex-teal
complex-teal8/22/2025

Invalidate QueryClient server cache

I’m using TanStack Query inside TanStack Start, and I’ve set the staleTime to 5 minutes. When I perform a mutation, I invalidate the related queries, which works fine on the client side. However, when I reload the page, the server still serves the old cached query data. This causes outdated information to be shown, even though the client cache has been correctly updated.
conservation-jade
conservation-jade8/22/2025

server-only isolation strategies (vite-env-only, `import 'server-only'`, etc.)

Hello! I wonder what strategies people adopt here to make sure no server-side code is leaking to their client budle or ssr outputs. I tried using import 'server-only' + vite-env-only blocking server-only, but that seems to create false positives when you use createServerFn....
adverse-sapphire
adverse-sapphire8/21/2025

Not encoded param in url cause SSR error when reloading

When reloading a page when the URL has a special value (ex: ê), and has a <Link /> component linked to the path with the param, it results in an error. see : https://github.com/olivier-deschenes/tanstack-start-not-encoded-uri-ssr-bug for demo ...
No description
optimistic-gold
optimistic-gold8/21/2025

Need Help! Child Dynamic Route Loader affects Parent Route Query?

I've the following setup: Using Supabase for auth/db stuff, i have defined both a client and a server instance in __root.tsx I call supabase auth getUser and getSession, pass it down to the component which uses useEffect to pass the session to the supabase client instance _protected.tsx beforeLoad checks if getUser() returns a user, redirects to /login otherwise /_protected/leads/index.tsx renders a table of leads, using a hook within the component that returns a useQuery which calls supabase (client instance) gets leads returns data...
afraid-scarlet
afraid-scarlet8/20/2025

What compiler Tanstack Start uses under the hood?

Hey, based on my shallow research, it seems that it uses vite-plugin/react, which uses babel under the hood. Babel is very slow AFAIK. Why use that and not the react-swc plugin instead, if you don't have any special babel plugins in the pipeline, it seems. react-router v7 uses babel for sure as they have some of the internal plugins I think, which is super sad, but for Tanstack I haven't see direct use of the babel capabilities, so react-swc might be good enough to be just drop in replacement with a boost in performance? In case you still see great performance and better build performance than Next.js, then I'm fine with Babel, but I'm not sure it will be as good when Turbopack is fully GA for both dev and production builds. I'm surprised SWC isn't a default thing here....
afraid-scarlet
afraid-scarlet8/20/2025

OpenTelemetry SDK Setup Issue with TanStack Start

I'm trying to set up OpenTelemetry in my TanStack Start project but running into build errors. My Setup - TanStack Start with cloudflare-module target - Installed @opentelemetry/sdk-node...
conscious-sapphire
conscious-sapphire8/20/2025

ClientOnly not working, error still raised on server side

Hey! I have some code which I want to only run on the client side (100ms live - https://www.npmjs.com/package/@100mslive/react-sdk). I am currently getting this error on the server: ...
constant-blue
constant-blue8/20/2025

Sentry setup with start?

Reading so many mixed/outdated templates on how to setup Sentry, anyone has some doc/repo to share?
helpful-purple
helpful-purple8/20/2025

Unit testing with Tanstack Start

Hey guys, I can't find any info on this so hoping someone here can help. I want to put unit tests in place for some of my server functions and middleware but I haven't been able to figure out how to call the relevant handlers. Currently the only way I can tests the handler logic is to split it out from the server function definition (i.e. export a function and supply to the .handler / .server methods) but this feels like overkill and I'm not sure I want to expose functions just for the sake of testing discrete parts of the flow - doesn't feel right....