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

adverse-sapphire
adverse-sapphire8/10/2025

"createRouter is not a function" after updating to `@tanstack/react-router-ssr-query`

Here is my router.tsx file ``` import { QueryClient } from "@tanstack/react-query"; import { createRouter } from "@tanstack/react-router"; import { setupRouterSsrQueryIntegration } from "@tanstack/react-router-ssr-query";...
secure-lavender
secure-lavender8/9/2025

hot module reload not working?

could you please help me understand why hmr is not working? I couldn't figure it out. https://github.com/Cuhadari-Deniz/t-start-mono i thought it had todo with the site being statically rendered so i tried ssr: false but had no luck. And in the html source code i can see global hooks that are looking like they are there for the hot module reload ... but nothing gets updated. ...
rising-crimson
rising-crimson8/9/2025

How to add custom unenv polyfills for cloudflare-module

I struggle using @aws-sdk/client-s3 with cloudflare-module preset. I keep getting the error Error: [unenv] fs.readFile is not implemented yet! at runtime, when I try to upload to/download from an S3 bucket or pre-sign URLs. Does anyone have similar issues when deploying to Cloudflare? Or now how I can add custom polyfills (unenv/node/fs in my case) on top of the default ones? I already tried the following: * Switching from cloudflare-module to cloudflare-pages following the TanStack Start docs for React (I'm using SolidJs)...
foreign-sapphire
foreign-sapphire8/9/2025

How do I stop server code getting leaked to the client?

Hi, I have an util that should only be used by server code in orpc that leverages the crypto module, but based on my browser logs I am getting errors such as: ``` Uncaught (in promise) Error: Module "crypto" has been externalized for browser compatibility. Cannot access "crypto.createCipheriv" in client code --- Uncaught (in promise) ReferenceError: Buffer is not defined...
stormy-gold
stormy-gold8/9/2025

How to Dynamically Update the Page Title After Rendering

How can I dynamically update the <title> tag after the page has been rendered? I am currently using the following code to render the title for pages: ```ts...
conscious-sapphire
conscious-sapphire8/8/2025

Is React 19 supported?

Is React 19 supported in Tanstack Start?
rare-sapphire
rare-sapphire8/8/2025

[ERR_MODULE_NOT_FOUND]: Cannot find module ... `esm` ... Did you mean to import ... `cjs` ...?

Hey all! First time poster here. Wish I didn't hvae to... I've been trying to deploy my TanStack Router SSR app to Netlify for the last couple days and I'm starting to lose hope. I thought something like that would be a breeze in 2025 but it looks like it's still a mess. So many yet so few pages documenting what needs to be done and all showing something different. Briefly looked at the TanStack Start page but seeing how it's a "framework" I ignored it... until today when I realised that it's not really a framework but just Router with a bunch of build tools on top of it. So I installed it and finally managed to get my project to build and deploy to Netlify but now it keeps throwing the following error in the function logs:...
automatic-azure
automatic-azure8/8/2025

Content flash with useOptimistic and router.invalidate

I'm trying to use useOptimistic to optimistically update some data. But when I call router.invalidate() (once the data has successfully been persisted), there is a brief flash. Minimal example in the thread....
eastern-cyan
eastern-cyan8/8/2025

Is installing Vite as a `dependencies` intentional?

As the title says, for context, I'm following the build-from-scratch guide and saw this (see image).
No description
unwilling-turquoise
unwilling-turquoise8/7/2025

Incremental Adoption Remix -> Tanstack

I've got a project at work that I think would benefit from Tanstack Start a ton... But I don't know of a way to split things up so that way it can be incrementally adopted. Because of vite constraints, is this something that even can be incrementally adopted? Or do you kind of have to dump everything over at once?
like-gold
like-gold8/7/2025

createServerFn POST vs GET

It seems like the docs don't specify when to use POST vs GET for a server function as you can technically write whatever logic you want inside and it gets serialized automagically using either. Wanted to know if there's any specific guidance here other than just using your best judgement to determine whether it should be GET vs POST? Also why is it limited to just GET and POST only?...
foreign-sapphire
foreign-sapphire8/7/2025

Centralized error handling

Hiii everyone, I am working on a huge educational project and we have a start frontend where the majority of serverFn's simply call another API We haven't figured out yet how to handle errors in a centralized manner, and this is forcing us to do a nasty try...catch everywhere, it is verbose and IMO unecessary, but we haven't found a better way yet Example of how we are handling errors, in this case the analytics api is external to the frontend....
fascinating-indigo
fascinating-indigo8/7/2025

How to check if a server function has a certain middleware

Say i have a middleware ```js export const requireAuthMiddleware = createMiddleware({ type: "function", }).server(async ({ next }) => {...});...
optimistic-gold
optimistic-gold8/7/2025

How to handle environment variables

I cant seem to find any documentation on environment variables. Are there any recommended ways of doing this? As of now i am currently using "@t3-oss/env-core" with env-client.ts and env-server.ts, however i feel like Start / Router / Vite offer a better solution for this. Anyone knows?...
inland-turquoise
inland-turquoise8/6/2025

router.invalidate() and auth history navigation

Hi all! I was trying out some auth patterns and came across this situation where: 1. A user is signed in at /dashboard 2. The user navigates to / 3. The user signs out 4. The user history navigates back to /dashboard...
other-emerald
other-emerald8/6/2025

Localised routing? e.g. /en/pricing + /pl/cennik -> should be handled by single file of pricing.tsx

(Paraglide) How to handle this? I am almost sure I've seen some docs few days ago about it, but spent over an hour looking for it now and cannot git it out. I have quite few languages so creating dummy files to handle each page in each lang is completely no-go because it will be unmaintainable. How to approach it? ...
like-gold
like-gold8/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?...
optimistic-gold
optimistic-gold8/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?
dependent-tan
dependent-tan8/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.
vicious-gold
vicious-gold8/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