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

complex-teal
complex-teal7/2/2025

How to handle server errors on the client side?

Hello, I am trying to learn TanStack Start and I want to show the error on the client side when an error occurs during RPC. How can I do this? Is it possible to subscribe to the states of the RPC on the server side without using a hook like useMutation? When using tRPC, we could catch errors thrown on the server side on the client side. I have this RPC: ```typescript...
No description
wise-white
wise-white7/2/2025

Does ReactQuerykit gives something extra if I am already using Latest TanStack Query

I am already using latest tanstack query with zodschema for run time validation. as I have read in tkdodo's blog that latest react query version has already type supports. is there something that react query kit helps with vanilla react query doesnot have....
adverse-sapphire
adverse-sapphire7/2/2025

SPA mode triggers `beforeLoad` throw redirect to login because of matched /_authed layout

I notice during the spa prerender that the beforeLoad in _authed/route.tsx runs which in out project throws a redirect to login if there's no session. It still seems like throwing a redirect is correct in examples but perhaps not for auth. Could this be something wrong with the prerender?...
correct-apricot
correct-apricot7/1/2025

Global Middleware not working after devinxi?

I'm finally getting around to updating my production app with the devinxi updates (1.120.3 --> 1.123.2). Everything seems to be working so far except my global middleware.
I've searched and found two GH Issues about global middleware not working (opened in Feb/Mar but have recent comments - e.g., https://github.com/TanStack/router/issues/3869) and at least one Discord post mentioning that global middleware isn't working.
I haven't seen anything concrete though about this being a known/accepted issue across the board. Maybe I just missed an Issue or something. Is it working for some people? Or is it not working at all post-1.121?...
fair-rose
fair-rose7/1/2025

Failed to fetch dynamically imported module

I am trying to build & run my Tanstack Start project with Docker. Building & running works, but I immediately get a runtime error and a network error: GET http://localhost:3000/assets/main-WtU-nrR_.js net::ERR_CONTENT_LENGTHMISMATCH 200 (OK) Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: http://localhost:3000/assets/main-WtU-nrR.js...
No description
genetic-orange
genetic-orange6/30/2025

How to handle static audio?

In an app where I have static mp3 audio files, where should I store them and how do I import them?
ratty-blush
ratty-blush6/30/2025

How do I read context in middleware?

Hi all, I have a middleware function in which I want to read the contents of 'context' to determine if I need to do something or not. Like the screenshot shows, context is of type 'never' but when I console.log the context out, I do see some values. How should I do this?...
No description
funny-blue
funny-blue6/29/2025

Can't create "/credits" route?

I started using TanStack Start about a week ago and everything has been going pretty well. I've ran into an issue where I can't create a credits page for my website because the routeTree.gen.ts generator, for some reason, ignores my credits.tsx page. Any other name for the .tsx file seems to work. It's just that credits.tsx specifically is ignored. Usually creating the file is enough for the route to be added to the routeTree file....
No description
wise-white
wise-white6/29/2025

Client not hydrating. no error message

Hi, I really want to give tanstack start a try, so I experimented with converting my nextjs app. I followed the migration guide here: https://tanstack.com/start/latest/docs/framework/react/migrate-from-next-js. I managed to get a couple of my pages rendering, but it seems only SSR is working (ie. the client never "hydrates"). I don't get any error messages. I tried removing most of the code for a single page and managed to get the client to hydrate and started adding code back in, but it's really unclear what causes the issue. In one case, simply importing a package (pino-pretty) caused it to stop working. This is so difficult to try to figure out that I'm tempted to give up. Besides this I'm getting weird vite build issues in third party packages too. Anyone have any ideas for how I can debug this or what causes it? Any help is greatly appreciated....
wise-white
wise-white6/29/2025

Start + useQuery prefetch question

Hi! I was under the impression that with react-router-with-query, we'd be able to start a query on the server and continue it on the client with useQuery, even when the query doesn't fully resolve inside the loader - essentially continue the query where the server left off. I'm wondering if that is actually the case or if that is only possible with useSuspenseQuery. In the example below, without any nested components, our query takes two seconds to resolve. If we prefetch inside the loader (without awaiting the prefetch or any subsequent duration), we will get data (1) from useQuery - the query runs fully in the client. When the loader is longer and allows for the query to fully resolve in the server, we get data (2), fetched in the server. ```typescript...
relaxed-coral
relaxed-coral6/29/2025

Do I need a start, or is just router enough?

Hi all! I’m planning my next web app (a spare-time project). I enjoy working with SPAs because they’re straightforward and avoid unnecessary complexity. The app is behind a login, so I don’t need SEO. I’m wondering: do I need start, or is using just router enough? Could start offer other benefits, like server caching or performance improvements? I’d prefer to keep the frontend clean and focused, without adding the complexity of a full-stack app unless it’s really worth it. Thanks!...
extended-salmon
extended-salmon6/28/2025

Is @tanstack/react-start still relevant? (maybe old setup)

Recently reinstalled a project I had started about a month ago. Running a fresh install, I'm seeing this error in the app.config file. Looking back at the docs, it seems like for the basic example, this app.config is no longer there. Just wondering if there was an update I missed. Thanks.
No description
metropolitan-bronze
metropolitan-bronze6/27/2025

Dexie/localStorage not working at all

Hello, Currently I'm migrating my Next.JS application to Tanstack Start. I use Dexie and localStorage very heavily and it isn't really working as expected. Dexie and localstorage reads are coming back as undefined....
correct-apricot
correct-apricot6/27/2025

I started a new project with Clerk and Convex, target deployment to CF Workers, build errors

I set up development and production environments in wrangler.toml and I'm attempting deployments both via GH actions and locally, with zero success. The error I'm getting during the nitro build is this: ```...
other-emerald
other-emerald6/27/2025

Upload file using server actions, the right way

Send type File to a server action. Currently the serializer does not let me pass it. Any guide or recommendation?
flat-fuchsia
flat-fuchsia6/27/2025

Scripts in Head are added and executed twice (also in basic-example). Should we add an identifier?

I noticed that scripts returned from the head function are returned and executed twice. This happens both with referring to a script like src: '/customScript.js' and also if you define it as children: "(function(){ console.log("Hello")})()" I think this is a bug, but perhaps there is a need to an identifier to it so tanstack start understands it are the same scripts?...
No description
genetic-orange
genetic-orange6/27/2025

The best way to manage new builds/deploy

What is the best way to handle the change of the server functions endpoint, since the URL of the server functions changes upon deployment, all users who are still on the old version will be affected by the change of the server functions endpoint.
quickest-silver
quickest-silver6/26/2025

If my server functions are calling other APIs, should I still use them?

So, I just deployed a landing page using tanstack-start (https://pricesurvey.io) and now I'm going to create a web application. I already have a backend setup in another application, even though tanstack start is a full-stack framework, at the moment my only requirement is to integrate the frontend with this other backend, with this context given, is it necessary/recommended to use server functions? If not, what to use instead?
jolly-crimson
jolly-crimson6/26/2025

Scss not importing

I recently removed app.config.ts and moved to vite.config.ts and suddenly all my css is not working. Is the a guide/example how the Tanstact start with Vite and scss modules should be set up? Thank you
wise-white
wise-white6/26/2025

Unit testing routes and middleware

How do you test things like createServerFileRoute and createMiddleware? one example of what i'm trying to do (this code doesn't work): ```ts...