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

manual-pink
manual-pink4/15/2025

How to check if form action (as server function) is running?

When setting a server function as action attribute on form-element, is there any way to determine if the action is currently running (like with useActionState from React)?
vicious-gold
vicious-gold4/15/2025

Secure env variables from get on browser

I have database and env variables, and want make sure that this not accessed by client in any way, is there a way to make sure that this happens, and get error or something if called from client?
mute-gold
mute-gold4/15/2025

How to avoid hydration errors with conditional rendering based on auth state?

Hello! I am getting a hydration error because my auth state does not line up on the server and the client. I have posted my component. Basically my auth function really only gets the session on the client leading to this rendering to be out of sync between server/client how would i fix something like this?...
No description
mute-gold
mute-gold4/15/2025

has anyone succesfully integrated TRPC with tanstack start WITH SSR?

looking for some guidance on this. how does trpc fit in with tanstack router? of course we store it in the router context... but how do we handle creating a new query client for each request AND where does useTRPC fit in there?...
mute-gold
mute-gold4/15/2025

has anyone persisted a query client on TSS?

looking for some guidance on this... i keep getting all sorts of weird hydration errors when trying to do this.
xenial-black
xenial-black4/14/2025

Am I using Tanstack Query wrong?

I have a tab with users and admins, when you press the users tab it fetches the users and when you press admins it fetches the admin. But when I am pressing the tabs back and forth the server then freezes, but it is really minimal data coming through, it is the server that is the issue or the way I am fetching the data
quickest-silver
quickest-silver4/14/2025

Loader responses for "non-components"

I've seen a few conversations around how to generate things like sitemap.xml and robots.txt, with the best approach so far being to create an API route (eg. /api/sitemap) with a Nitro redirect (/sitemap.xml => /api/sitemap). This works okay-ish. This made me think, have you considered allowing Response objects to be returned from a file route's loader? If it is a Response object, the whole component tree can be ignored in favour of the Response. This approach would allow creating dynamic sitemaps and similar files quite trivially....
afraid-scarlet
afraid-scarlet4/14/2025

how to ged rid of logs

how to hide logs like ServerFn Request: app_modules_functions_session_ts--getServerSession_createServerFn_handler in the console?...
vicious-gold
vicious-gold4/14/2025

vinxi start doesn't load .env in node envorment

DB_FILE_NAME=file:sqlite.db pnpm start this works but pnpm start seem env not working on production build
flat-fuchsia
flat-fuchsia4/13/2025

ssr only for a few pages?

Hey, I'm taking a serious look at adopting tanstack start. I do not build ecom apps or usually anything that is not behind a login. I'm on the fence atm about some things. I'm thinking of turning this particular production application into a tanstack app either with router or start. On one end, I could use astro for the domain.tld and about contact etc. the usual marketing stuff and then just tanstack router for the dashboard stuff at app.domain.tld. This seems mostly fine to be but also keeping...
passive-yellow
passive-yellow4/13/2025

How to change localhost to custom host in dev

In Vite, I can change the local dev server hostname with server.host: https://vite.dev/config/server-options.html#server-host And then allow my custom hosts via server.allowedHosts How can I do this in Start?...
genetic-orange
genetic-orange4/13/2025

Automatic code splitting not working as expected

I'm using tanstack start for a project and I noticed that the automatic code splitting doesn't seem to be working as expected. In the network tab I notice it downloading components and imports that are not used in the route that the user loaded (I created a completely new empty test route to ensure its not importing anything), but components/imports from other pages are still downloaded. For example, this userProgress component is being fetched even though it's not used on this page, and searching throughout my project I can see it's only imported in other different routes (i.e. it's not accidentally being imported in some shared component or layout). I would expect that this component would only be fetched when loading a page that imports it, or prefetching that page (e.g. on hover for a link). But it seems that automatic code splitting is not functioning and everything is always being fetched regardless of if it is used....
No description
vicious-gold
vicious-gold4/13/2025

Disable SSR for route

I am using "react-json-view" in one of my routes and this cause error in image, so I try to disable SSR for this route with " ssr: false," but still get same error, why ?
No description
xenial-black
xenial-black4/13/2025

server function error handling

I just started to learn start. and I'm trying to figure out how to handle errors, specifically validator and middleware ones. I don't want to have the whole error stack on the client; ```ts const ContactForm = z.object({ name: z.string().min(2, 'Please enter a valid name'),...
gradual-turquoise
gradual-turquoise4/13/2025

Is there any tool to assist the NextJS to TanStack?

I mean, especially router differences and stuff... I'm much more a mobile dev than web dev...
vicious-gold
vicious-gold4/12/2025

Add tanstack query to tanstack start ssr

I create a query client in the frontend and in the backend. I wrap the rootcomponent with a QueryClientProvider and pass whichever queryclient is available to the provider. When I visit routes other "/" like "/login" without first navigating to the index, it throws an error about a missing queryclient. Is there a detailed guide on how to integrate tanstack query with my start app?
extended-salmon
extended-salmon4/12/2025

Import Css

Where should I import CSS: in __root.tsx and <head> , in router.ts, or both? And what’s the difference?
gradual-turquoise
gradual-turquoise4/12/2025

Can I have custom SRC folder structure?

I have a dashboard and a discord bot projects. And I want both of them in the same repo. My idea is to have ./src/bot and ./src/dashboard. Does Tanstack handles it? Cause NextJS does not (and I wanna get rid of it)....
absent-sapphire
absent-sapphire4/12/2025

Validate FormData server action with input type="file"

Hello, I'm trying to validate input file on the server but the validation fails: ``` issues: [ {...