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

evident-indigo
evident-indigo4/9/2025

Need help setting up SEO

Hello, I'm trying to render the SEO tags for my library category page on the server. Right now I have an useEffect to set
document.title
document.title
and append meta tags to the head. This should be possible on the server right. Where are the examples with Router or Tanstack start?
other-emerald
other-emerald4/9/2025

Safe to use? (Not leaking credentials to client)

Hi, I plan to use nodemailer to send email, using ServerFunctions. i it safe to have it setup like this: ...
other-emerald
other-emerald4/9/2025

Tanstack Stack Production

I want to try Tanstack Start for my upcoming project about the healthcare system, (e.g. medicine inventory system, patient management, supplier management). Can I use Tanstack Start at the production level now?...
ambitious-aqua
ambitious-aqua4/8/2025

Request object - IP address?

How to get client IP address from an API Route (or a ServerFn)? The usual objects like .socket aren't present....
noble-gold
noble-gold4/8/2025

Switched to client rendering because the server rendering errored:window is not defined

I am migrating to Tanstack start, and have window object used in UI lib, but I am still get this error and SSR is disabled because of this, and same for location how to solve this in Tanstack start ?...
No description
continuing-cyan
continuing-cyan4/8/2025

Lazy loading component: `Error in renderToPipeableStream: ReferenceError: window is not defined`

When loading that component: ```tsx import { Suspense, lazy } from "react"; ...
exotic-emerald
exotic-emerald4/8/2025

Programmatically get path in `__root.tsx`?

I'd like to get the current URL path within my __root.tsx. Is this possible? My goal is to define my canonical URL in my head's links:: ```ts {...
No description
rare-sapphire
rare-sapphire4/7/2025

Inference lost in server function

Hello, I'm quite new to typescript but I don't understand this case where I have a middleware which, using its own validator return typed data but: - If just after the middleware i connect it to the .handler then the types are correctly inferred for data. - If I use the server function .validator after the middleware then the type of data is lost. ```typescript...
ambitious-aqua
ambitious-aqua4/6/2025

Server seperation

We can use createServerFn to create functions which are callable but not directly part of the client bundle (as far as I understand). How do we create server side functions which are NOT callable by the client? For server side utilities and common functionality....
flat-fuchsia
flat-fuchsia4/6/2025

first page nav slow even on purely spa routes

is it expected that, even with ssr: false and no network requirements for a route, that the first client navigation will be slightly delayed? is there something going on behind the scenes i'm not accounting for? i have a couple really basic routes for testing, eg. ```tsx...
rare-sapphire
rare-sapphire4/6/2025

POST server functions returning 500

This happens only when deployed to Vercel (locally it's working fine) The relevant log I'm getting: TypeError: f.split is not a function...
wise-white
wise-white4/6/2025

OAuth implementation

Has any already accomplished a next-auth like generic oauth implementation without using better-auth. Haven’t saw any demo/tutorial version doing that.
noble-gold
noble-gold4/6/2025

Can I use Virtual file routes with tanstack start ?

Can I use Virtual file routes with tanstack start like in tanstack router?
noble-gold
noble-gold4/6/2025

Virtual file routes with Tanstack start

I am trying migrate from tanstack router to tanstack start but I have issue to use virtual file routes with Tanstack start As it keeps get routes automatic from file in routes, I setup routes from vite.config.ts Do I need to configure anything more ?...
national-gold
national-gold4/5/2025

How to post multi-part form data in server fn?

I am posting a form on the client. You can see the image is what is captured before calling mutate using tanstack query. The request does not contain the file object because it defaults to request headers of content-type application/json How do we post multi-part form data with a server function?...
No description
ambitious-aqua
ambitious-aqua4/5/2025

tanstack start with powersync error

im getting cannot find module errors https://codesandbox.io/p/devbox/k8kvyx minimal recreation of problem. i am looking to know if powersync is able to be used in a app stack like such:...
sensitive-blue
sensitive-blue4/5/2025

Headers missing on initial load from server

Anybody else seen cases where on the initial load of the app when calling a server function in loaders the headers are not complete, particularly things like cookies and auth headers. It seems on initial load my auth headers are missing, but then as soon as I navigate around or even just clicking try again button on the on the client it works fine.
flat-fuchsia
flat-fuchsia4/4/2025

searchParam validation causing hydration error?

I'm hitting this weird error where my whole app was working fine- i have basically two subtrees, one with basically default Route configs, and one for the "app" where every route config sets ssr: false Then, I introduced searchParam validation at the highest layout of my spa tree using ArkType, and i'm getting hydration errors (they go away when i get rid of the arktype validation and just manually provide a cb to validateSearch I'll provide some more info in the followup post, but i'm not really even sure where to begin debugging this. i can try using it a different validation library and see what happens, but wondering if maybe i'm doing anything obviously wrong before i bother with that...
generous-apricot
generous-apricot4/4/2025

Data Loading with Start

I have a couple questions about how to load data with Tanstack Start/Router. I think the crux of my confusion is around whether the loader function runs on the client or server. It seems like the answer is both, but I'm sure how to think through the implications of that. 1) We currently use Redux as an API cache & we're hoping to use Tanstack Start as a way to essentially "pre-warm" our Redux store. So the idea is that we use Tanstack loaders to fetch the data on load immediately, then send it straight to Redux & use redux selectors to render our components. It seems like this page covers this usecase (https://tanstack.com/router/latest/docs/framework/react/guide/external-data-loading), but I'm not sure exactly how I would do this with Redux. Do I call dispatch inside loader function. Is that going to work if loader is being run on the server? Is there some kind of afterLoad function that I can call after loader returns but before the component renders? 2) How can I access request headers inside loader? I need to access headers to properly load data, but that's only relevant for the initial SSR request. Do I use server functions for this? Ideally I want to be able to say: if this is the initial SSR load, then give me the header, otherwise give me undefined....
evident-indigo
evident-indigo4/4/2025

Anyone using Nuqs with Tanstack Start?

In my existing codebase (nextjs) I am using Nuqs all over the place, but Im running into an issue with the existing adapter for react. Is anyone able to use Nuqs with Tanstack or is it an anti-pattern with Tanstack Router? So far I'm used to the syntax of Nuqs and its ease of use with useState....