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

ambitious-aqua
ambitious-aqua5/6/2025

Accessing request object in the Route.loader

I would like to get access to request headers in the loader to get the IP address (to display that the service is not available in certain countries). What is the proper way of getting access to the request object / headers in the loader? I have tried adding getHeader but that causes a build error....
absent-sapphire
absent-sapphire5/6/2025

Routes conflicting when using "@tanstack/react-start/api"

I have a dynamic endpoint - /api/$workspaceSlug/$projectSlug And a static endpoint - /api/ai/chat When I make a request to /api/ai/chat, the request is going to /api/$workspaceSlug/$projectSlug. It thinks* ai is the workspace slug and chat is the project slug, so it ends up returning the wrong response. ...
wise-white
wise-white5/5/2025

Vinxi & Nitro

In this message: https://discord.com/channels/719702312431386674/1238170697650405547/1368552695388180602 it seems as though both Vinxi and Nitro will eventually be deprecated (the latter apparently only at runtime). While I understand Vinxi (since it's an extra layer too close to TSS) I don't understand why we should get rid of half of Nitro integrations and goodies (e.g. background jobs). I thought Nitro (and the ecosystem of plugins) as a base was one of the main advantages of TSS over comparable solutions (e.g. Next). And it was touted as a great time saver which would enable contributors to work on things that actually matter DX wise as opposed to dealing with "low level" stuff that Nitro takes care of. I'm wondering if there's a written rationale for this decision and I wonder if there's a better way to announce these major changes in direction for the future....
firm-tan
firm-tan5/4/2025

serverFn signal is always aborted on POST?

I have this server function: ```ts export const getAgents = createServerFn({ method: "GET" }).handler(({ signal }) => { console.log("aborted:", signal.aborted) return listAgents()...
flat-fuchsia
flat-fuchsia5/3/2025

How to handle POST requests to component routes (non-api) and read the payload (form data, json)

I'm implementing an OAuth flow with Google and need a route that'll receive a POST request with the credentials payload. I have this currently working with an api route, but during payload verification some errors can throw that I want to present a nice UI for using the Error Boundaries I have for the rest of the application. I want to just have a regular route, but unsure how to access the form data from within either the loader or a server function. In Remix/React Router, I could do this very easily like so: ``` // Handles the POST request from the Google OAuth callback...
unwilling-turquoise
unwilling-turquoise5/3/2025

Sharing data between `ws` implementation and `createServerFn` util

So I followed this guide https://nize.ph/blog/tanstack-start-websockets/ to implement websockets in my Start application, but I'm having some trouble being able to share data between the WS server, and some server-side routes created with createServerFn. My goal is to have the ability to send a websocket message from a server function. The way I've tried to do this, is to create a Map() instance, in which I place websocket "peers", and then I'm attemting to retreive the appropriate peer from the server-side function. However, the Map isn't shared, it seems like the file where createServerFn is located, is loaded dynamically by Start, which means the Map is always a new instance rather than being the existing one. TL;DR on code: - src/lib/peerManager.ts exports a singleton export const peerManager = new PeerManager(); - src/ws.tsx imports the singleton, handles websocket, works great...
fascinating-indigo
fascinating-indigo5/3/2025

path error with static server function.

I have the following error when using a static server function. Any static function. Making it dynamic fixes the problem. ``` TypeError: The "path" argument must be of type string. Received undefined...
useful-bronze
useful-bronze5/2/2025

middleware for createAPIFileRoute?

I can't figure out how to use middleware for createAPIFileRoute is this supported?...
national-gold
national-gold5/2/2025

Using unhead v2

I want to use unhead by unjs and would appreciate the help on how to implement the ssr part as mentioned in the screenshot
No description
probable-pink
probable-pink5/2/2025

Public DIR as upload files. in tanstack start

can we use public file as upload DIR ? i m having issue in production it is not workin in local it is working...
like-gold
like-gold5/2/2025

Calling TRPC directly

Can I use TRPC createCallerFactory with tanstack start in any way in server side without tanstack server functions?
extended-salmon
extended-salmon5/1/2025

redirect on error

Hello everyone. I am trying to trigger a redirect to /auth/sign-in when the error code of tRPC is "UNAUTHORIZED" ...
extended-salmon
extended-salmon5/1/2025

Observability support / otel integration

According to the docs, TanStack Start integrates seamlessly with observability tools to provide comprehensive insights into how your application behaves in production, helping you ensure that everything runs smoothly. Can anyone give more details around this? Looking at the reccomended sentry integration, I dont understand how its tracing anything or how to use this as a guide for writing my own integration (I would like to use datadog / otel). From what I can tell, its simply just creating a middleware that does nothing. I would love some more information on how tanstack start integrates semlessly with observability....
extended-salmon
extended-salmon4/30/2025

Using Bun functions in server functions

Hello, I am trying to call this in TS Start in order to get a pre-signed upload url for AWS S3: ```ts // s3.ts import { randomUUIDv7, s3 } from 'bun'...
robust-apricot
robust-apricot4/30/2025

Client-side Loaders?

I have an external @xstate/store which I use to keep track of some user preferences. Those preferences get persisted via cookies and loaded during beforeLoad. What is the correct way to populate a client side store like xstate with those values from the server? I know I could: ```tsx const { userPreferences } = Route.useLoaderData(); ...
harsh-harlequin
harsh-harlequin4/29/2025

Disabling Server Logs

Is there a way to disable/hide all the server functions console logs
ambitious-aqua
ambitious-aqua4/29/2025

Meta title and description on Tanstack Start based on route params or search query.

Hey! Somewhat similar to https://discord.com/channels/719702312431386674/1340017921094844416 but what I need is to adjust the title of the page based on a url search param. Essentially, like getting the post id from the search params and setting the title to the post name. (simplified for this question)....
foreign-sapphire
foreign-sapphire4/29/2025

tauri 2.0 / vite & Tanstack

what's the status of tanstack start with vite react? also what does the compatibility with tauri 2.0 look like?...
foreign-sapphire
foreign-sapphire4/29/2025

TanStack Start Blog Samples (Markdoc or the like)?

Does sombody of you know / have any samples of Tanstack Start with a nice blog setup? If possible multilingual?
like-gold
like-gold4/28/2025

Amplify Authentication

Hej all. I have a question regarding Tanstack Start and AWS Amplify authentication. We was using NextJS and had the authentication working but trying to move over to tanstack start i cant seem to get the user data after i login. I am not using the aws/ui Authenticator component