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

correct-apricot
correct-apricot11/24/2025

Notify users frontend version changed

Hello, I want to notify my users with a toast, that the current version of the web app is outdated and they need to reload their page. Anyone suggestions how to archive that?Thank you!
other-emerald
other-emerald11/24/2025

Type Inference from `createServerFn`

Seemingly having an issue that is similar to https://github.com/TanStack/router/issues/5788 however there is no hint that it deals with the return type involving functions which are not serializable. Some context: The server function: ```ts...
extended-salmon
extended-salmon11/24/2025

Tanstack start deployment using bun.

Hi, I was following the documentation guide for deploying using bun: "https://tanstack.com/start/latest/docs/framework/react/guide/hosting#production-server-with-bun". Now when i run the bun run server.ts locally. It works fine. But when i deploy it on a server. I don't get anything. Here are my curl responses. I created a health route which works fine but the main app is not working. curl response of index: ``` ubuntu@server:~$ curl -v localhost:8100 * Host localhost:8100 was resolved....
foreign-sapphire
foreign-sapphire11/24/2025

TanStack Start + Nitro: 404 pages showing 'Cannot GET' instead of notFoundComponent

Environment: - TanStack Start: v1.139.3 - TanStack Router: v1.139.3 - Nitro: v3.0.1-alpha.1 - Vite: v7.2.4...
exotic-emerald
exotic-emerald11/24/2025

No .output after build

Previously I had .output folder after doing build, after upgrading it doesn't seem to create that one. I even tried cloning the tanstack-start-example-basic and did build, and it doesn't create it either. I still see "start" in the package.json, but also "preview". "preview" works when testing, but the name implies that it is just that, a preview, so I assume "start" should work....
rare-sapphire
rare-sapphire11/24/2025

ERR_MODULE_NOT_FOUND after 1.36 --> 1.39 upgrade

Hi, When truing to build (vite build --mode production)and deploy the application I now receive this: ``` Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/jingles/Documents/workspace/my-app/dist/server/server.js' imported from /Users/jingles/Documents/workspace/my-app/node_modules/@tanstack/start-plugin-core/dist/esm/preview-server-plugin/plugin.js at finalizeResolution (node:internal/modules/esm/resolve:275:11)...
rising-crimson
rising-crimson11/24/2025

How to return 404 status from Server Function without breaking the response payload?

Hi! I'm encountering an issue when trying to return a 404 status from a createServerFn. When I use setResponseStatus(404) and then throw an error, instead of receiving the error payload in the client, the server returns a generic HTML 404 page saying "Cannot GET /_serverFn/...". It seems like setting the 404 status causes the underlying server to treat the server function endpoint itself as "not found", masking the actual application error I want to send....
rising-crimson
rising-crimson11/24/2025

Preventing raw Zod error exposure in createServerFn validation

Hi everyone! 👋 I'm using createServerFn with .inputValidator() using a Zod schema. When the input validation fails, the server function throws the raw Zod error array to the client. I would like to know if there is a recommended way to intercept this validation error to return a simplified message (e.g., just "Invalid UUID") or a custom error structure, instead of exposing the full Zod error object....
No description
fair-rose
fair-rose11/24/2025

Is there a way to attach stuff to "window.__stuff__" during SSR?

I'm wondering if it's possible to have the root route contain ``` <script> window.stuff = somethingWeOnlyKnowOnTheServer;...
fair-rose
fair-rose11/23/2025

Including X-Request-Id in response header + request context

I'm having a bit of trouble achieving this, this is what I currently have (for setting the response header), and in my commented code I've got my previous implementation (for including in the request context), how do I get both to work? ```typescript // server.ts import crypto from 'node:crypto';...
unwilling-turquoise
unwilling-turquoise11/23/2025

How do I connect to Hyperdrive using Tanstack Start?

Hi, I have the following but I can't access my Hyperdrive binding from src/db/index.ts. `import { drizzle } from 'drizzle-orm/node-postgres' import { Client } from 'pg' ...
inland-turquoise
inland-turquoise11/22/2025

I selected shadcn in the pnpm create cli but it got ignored

There seems to be a bug in the pnpm create cli becuase I selected shadcn in the pnpm create cli alogside with tailwindcss db and clerk ,db, tailwindcss and clerk got installed but shadcn not.
extended-salmon
extended-salmon11/22/2025

Error: Could not resolve entry for router entry: router in PROJECT_ROOT/src

Is src/router.tsx treated as a special file ? In the Authenticated Routes example, there is no router.tsx, only a main.tsx https://tanstack.com/router/latest/docs/framework/react/examples/authenticated-routes?panel=code But when I try to use only the main.tsx file, the app breaks with a very obscure message ```...
equal-aqua
equal-aqua11/21/2025

Hydration error even when not rendering anything ?

Hi, I'm new to React and its hydration errors. I'm coming from Qwik/Solid. I'm getting the Hydration error in my console. So I tried to pinpoint what component triggers it. And I ended up rendering nothing (Commenting <Outlet/> in __root.tsx): ...
optimistic-gold
optimistic-gold11/20/2025

Prerendering dynamic pages

Hi, docs say that we can't prerender pages with dynamic params unless some other page links to it. Any way we can provide those dynamic params during build? Like fetch('/products') and pass id's to the prerender config? That's nextjs equivalent however I did not find it for tanstack start https://nextjs.org/docs/app/api-reference/functions/generate-static-params ...
vicious-gold
vicious-gold11/20/2025

Applying middleware to the public folder

Hi - I'm trying to authenticate access to a React SPA for which I don't have access to the source code. The SPA is distributed as a set of static files that are simply served from a sub-folder of your public folder. I'm using this SPA, an image viewer, in the context of a larger Tanstack Start app. My first thought was to run a middleware on the Root route and check if the URL matched the sub-folder where the SPA app is installed. Well, I found out that middleware does not run for requests to...
dependent-tan
dependent-tan11/20/2025

show detail error in browser?

in local dev, is it possible to show detail errors directly in browser? currently i have to go back to temrinal console to see what's wrong.
No description
unwilling-turquoise
unwilling-turquoise11/20/2025

getHeaders Import Not Found in @tanstack/react-start/server

I'm getting a TypeScript error when trying to import getHeaders from @tanstack/react-start/server. version: @tanstack/react-start@^1.132.0...
No description
sunny-green
sunny-green11/19/2025

Outlets remounting full url

This may be a question for the router channel but I am using Start so just putting it here. I have a route /writing that has a list stacked sidebar layout. My understanding of outlets is that they are supposed to keep layouts the same for all child routes. so /writings layout when using an Outlet, would not remount when I go to /writing/$slug. However, it is remounting each time I go to a child route. ...
ambitious-aqua
ambitious-aqua11/19/2025

Setting status-code from loader

Has anyone found a good way to set the response status code from a loader during SSR? setResponseStatus does nothing. I need to set the status code to 404, but without throwing an error in the loader. Ideally, I would like to render the page as usual using the loader's result, but use the status code to signal indexers, etc., that the site is "expired". Alternative approaches: ...
Next