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/6/2025

Basic HTTP Authentication

I am trying to implement basic HTTP authentication on an /admin route. The middleware section of the docs is a bit confusing as I'm not totally sure how I can specify a middleware to run before on a specific route everytime? I tried using the beforeLoad method, but it's a bit unclear if I have to create a middleware, wrap it in a server function, and then call it in my beforeLoad or if there's a simpler way to do this?...
sunny-green
sunny-green8/6/2025

What is the tanstack way of doing loading? (Example: Next.js has loading.tsx)

Is there a way i can add a loader to a specific road that does server-side loader?
harsh-harlequin
harsh-harlequin8/6/2025

How can I route app.website.com and website.com differently in the same TanStack Start app?

I want to serve both website.com (for the public homepage) and app.website.com (for auth and dashboard) from the same codebase and deployment.
united-yellow
united-yellow8/5/2025

Cannot read properties of undefined (reading 'isDehydrated')! (tRPC)

Suddenly started getting this trpc error which is causing the frontend issue. Sometimes it load the data on try again, but most of it's not working. error on server logs: ``` tried to stream query [["images","categoryImageList"],{"input":{"category":"poster","page":1,"perPage":24},"type":"query"}] after stream was already closed....
No description
rare-sapphire
rare-sapphire8/5/2025

Footer with sum

Hi! Is there any way to display a simple sum of a column's value in its footer? I've only found aggregationFn as part of the grouping API, but I don't know if it's right for summing column values. Or is there simply no automatic way to sum columns?...
deep-jade
deep-jade8/4/2025

Making the api backend typesafe

Hello hello fellow builders. I have a working webapp with some server functions for my frontend. Now I would like to make an http api as well for some of my users to consume. I naively though I could just createServerFileRoute() and call my server-functions from here to also have a REST version of my stuff....
afraid-scarlet
afraid-scarlet8/4/2025

Changing base path does not seem to work for ingress

Hi I've been tearing my hair out for a while on this issue. We basically have multiple apps on a single domain: customer.company.com/app-a, customer.company.com/app-b, customer.company.com/app-c. We use ingress to manage routing when users visit specific domain/folder combinations. However, there seems to be an issue where I can't figure out how to tell TanStack Start to understand this setup: ...
like-gold
like-gold8/4/2025

Getting headers inside of an SSR component

```ts import { useEffect, useState } from "react"; export function useShortcutKey() { const [shortcutKey, setShortcutKey] = useState("Ctrl");...
eastern-cyan
eastern-cyan8/3/2025

"Cannot read properties of null" error in a test that renders a component that uses useState

I'm seeing TypeError: Cannot read properties of null (reading 'useState') when running a test (Vitest/Testing Library) that renders a component that uses a hook that uses useState and useEffect hooks. The first version I noticed this happening on is the 1.129.1 release of Start, so I'm hoping that may narrow things down and point to what might be causing this. I've tried the latest release of Start (1.130.15) and several prior to that and all result in the same error.
adverse-sapphire
adverse-sapphire8/3/2025

Build failing because of parsing error

Hey guys! I am integrating Lingui with TanStack Start (React + Vite), and I am running into a build error because, for some reason, the Tanstack Start plugin tries to parse the .po translation files, which I am dynamically importing. My Vite config setup: ``` export default defineConfig({...
dependent-tan
dependent-tan8/3/2025

How to Add a Catch-All Error Handler Middleware in createServerFileRoute?

I'm using createServerFileRoute to define my server routes. I want to implement a catch-all error handler middleware that logs errors to the console and returns a 500 status code for any unhandled errors. In the documentation, I see that middleware can be registered using registerMiddleware, is that only can be used with createServerFn. How can I add a global error handling middleware when using createServerFileRoute?...
relaxed-coral
relaxed-coral8/3/2025

Problem using a serverFn in a route loader

When I use a serverFn in an async loader handler, I get this error in the browser: renderRouterToString.js?v=a5d97e8c:1 Uncaught (in promise) SyntaxError: The requested module '/node_modules/react-dom/server.browser.js?v=a5d97e8c' does not provide an export named 'default' (at renderRouterToString.js?v=a5d97e8c:1:8) I don't understand the error-message, or how to fix this... please help 🙏...
national-gold
national-gold8/3/2025

Better Vercel Observability

Is it possible to get better vercel observability? Im not sure if this is a TanStack Start, Nitro, or Vercel issue, But im having a hard time to know how/where to optimise since all the requests just get bundled up on the vercel dashboard as __nitro...
No description
dependent-tan
dependent-tan8/3/2025

Persist Sidebar Toggle State Across SSR and Client Hydration in React with Zustand?

I have a sidebar that users can toggle on and off. To persist the sidebar’s open/closed state across page reloads, I’m using Zustand with its persist middleware. The challenge I’m facing is related to server-side rendering (SSR). Since the initial page is rendered on the server, the persisted state isn’t available during that phase. As a result, the sidebar always renders as open initially, and only after client-side hydration does Zustand apply the persisted state, causing a visible UI flicker. I’m wondering if there’s a better approach to handle this, such as storing the sidebar state in cookies or another method that works seamlessly with SSR and hydration....
rival-black
rival-black8/3/2025

session is always called on hover

i have my __root.tsx with ```beforeLoad: async ({ context }) => { const session = await context.queryClient.fetchQuery(authQuery.session); return { session: session.data?.session,...
dependent-tan
dependent-tan8/2/2025

Cannot read properties of undefined (reading 'isDehydrated')

Whenever the dev server reloads, I keep seeing this error and after I refresh manually, this goes away
No description
fascinating-indigo
fascinating-indigo8/2/2025

Deployment help

I'm trying to deploy my app to Railway but can't seem to get it right. After building the app I run vite start but that does not work. The docs outline that we need to use npm run .output/server/index.mjs but that does not work either. ...
rare-sapphire
rare-sapphire8/2/2025

"Cannot use 'in' operator to search for '.' in ./index.js"

I'm running into an issue with my monorepo setup using TanStack React Start and could really use some help. My Setup: - Monorepo with pnpm workspaces and Turbo - TanStack React Start v1.130.12 - Vite v7.0.6...
national-gold
national-gold8/1/2025

Vercel 404 Error After Deployment

I'm having trouble when deploying to Vercel. I'm using monorepo with NX, already setup everything, build and install commands, the "vercel build" works correctly, also the "vercel deploy", but when i try to access the application it falls on 404 error. None of the application pages is found. None logs in Vercel Dashboard.
No description
afraid-scarlet
afraid-scarlet7/31/2025

Dehydrating/hydrating queryClient

How can i properly "hand off" the queryClient to the client, using TanStack Start with ssr: "data-only"? Currently I don't do any hydration. This means I'm fetching data first on the server, then I throw it all away and fetch everything again on the client, completely negating any benefits of running the loader on the server. I've read some docs:...