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

continuing-cyan
continuing-cyan6/8/2025

tRPC + Custom Auth

Hi again! I was hoping someone could help with a cookie problem I have. I'm pretty new to the world of SSR (I think SSR is where my issue lies, please correct if I'm wrong). I was looking through https://github.com/makyinmars/tan-stack-start-full-stack/?tab=readme-ov-file#tan-stack-start-full-stack for custom auth, which is pretty similar to what I've used with NextJS previously, it follows the Lucia guide for rolling your own auth service. Anyways, I have a function which creates a token and a session but when I try to set a cookie, I get the following error: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client. I'm using setCookie from vinxi/http, also tried with setCookie from @tanstack/react-start/server. Here's the function that's throwing the error: ```...
variable-lime
variable-lime6/7/2025

Layouts and Pathless Routes

Tried to read the docs for multiple times but cant seem to figure out a "perfect" way to do what i want with file + flat router structure ( in the image attached ) Probably a router question move if this is not the right fit here - So i want a pathless _dashboard to gate all the auth stuff and show the actual "private" layout, all good here....
No description
xenial-black
xenial-black6/7/2025

Flash of unstyled content when hosted

Whenever I host a TanStack Start app in a VPS using a dockerfile, and I visit a page I always get a flash where no single style is applied, then a split second later, the styling gets applied. This doesn't happen when I host on Vercel. On Vercel, the only styling that doesn't get applied as soon as the page loads is the font. I get this issue on both the vinxi and devinxi (alpha) versions. Please, how do I fix this?...
ratty-blush
ratty-blush6/7/2025

Generate ssr file like xml & txt

Is it possible to generate ssr file like xml or txt ?
stormy-gold
stormy-gold6/7/2025

Changelog & Roadmap

Hi beautiful people. Is there a changelog and roadmap page for tanstack start I can follow/read to keep updated?
secure-lavender
secure-lavender6/7/2025

Websocket alpha

Does Start support websocket yet? If so, is there any documentation on setting it up?
other-emerald
other-emerald6/6/2025

hosting monorepo vercel

I am trying to deploy a start app on vercel. I have added the preset: 'vercel' in the app.config.ts file. and on vercel I have setup this configuration for the build and deployement settings ``` Build command: cd ../.. && npm run web:build Output directory: .vercel // I tried to leave it empty but I had a 404...
solid-orange
solid-orange6/6/2025

beforeLoad or loader called multiple times

Hi! I'm having an issue with start and router. If you have nested routes or pathless layouts it will call beforeLoad from the parent on each child page. Following the authentication example, we get the user inside the beforeLoad method in the __root.tsx file, then each nested route will call that server function before render You can see the problem here: https://tanstack.com/start/latest/docs/framework/react/examples/start-basic-auth when navigating to posts it will call it 3 times before rendering Is that expected?...
eastern-cyan
eastern-cyan6/6/2025

ClerkHandler type (Clerk+Convex+TSS) error when moving to alpha branch

Cross post from a thread in the general chat, but I believe this might be a larger error so I'm publishing here. Let me know if you all would like me to submit a github issue. Error: Within server.tsx: ```...
genetic-orange
genetic-orange6/5/2025

Hybrid SSR + SPA in TanStack Start?

I currently maintain two separate projects that are organized in a monorepo: • A TanStack Start app (SSR) that serves as an admin/dashboard for configuring my main app • A TanStack Router SPA for the core user-facing experience (client-side routing only, for performance and offline support) ...
foreign-sapphire
foreign-sapphire6/4/2025

getQuery not working in ServerRoutes (devinxi)

Before devinxi:
const { provider, clientID } = getQuery();
const { provider, clientID } = getQuery();
Now I have to do this: ``` const requestURL = getRequestURL();...
unwilling-turquoise
unwilling-turquoise6/4/2025

Flash Of Unstyled Content

whenever i reload the page or getting to the new page , The html renders fast. But the css take 2 or 3 seconds to load.
national-gold
national-gold6/3/2025

All modules from other routes loaded

Perhaps I made a wrong assumption but let's say I have a route /auth and /dashboard and /settings. Currently when I load /auth on development it loads ALL modules defined in the route files from /auth + /dashboard and /settings. Is this intended? I was expecting it to not to load the /dashboard and /settings chunks. Or is the recommended way to move the route component to another file?...
conscious-sapphire
conscious-sapphire6/3/2025

Leaking Payload CMS code into client

I'm trying to integrate Paylaod CMS into Tanstack and failing spetacularly. The main problem is that no matter how hard I try to isolate paylaod and not have it leak into the client, it keeps somehow making its way there. In the end this is the error i get: ```...
foreign-sapphire
foreign-sapphire6/3/2025

Type errors chaining middleware together.

In the docs, it suggests you can chain middleware together while building up state in context. But in this case, the context is not typed unlike the majority of Start because the middleware can be used in different spots. Maybe we should add an explicit typing for the context that each middleware supports? Something like createMiddleware().context( z.object( { authUser: AuthUser.optional() } ).passthrough() ).validator(.....).server(...)...
No description
cloudy-cyan
cloudy-cyan6/3/2025

Form is somehow getting server rendered? RHF

Hi all, Currently porting my Next JS app to Start but running into issues with my form component. When I console log form, it get's logged in the terminal. I'm assuming this may have to do with how my route is set up, but I'm not sure how to adjust. I appreciate any advice. ...
eastern-cyan
eastern-cyan6/2/2025

throw redirect() not working in loader.

I wanted to add a redirect to the right url if some tried to use sany invalid url for. but some how it's not working as it suppose to. Not redirecting nor rendering anything for invalid page aswell!!! Any idea?...
No description
stormy-gold
stormy-gold6/2/2025

Load a static file in top-level directory dynamically with environment variables

I have a file that I need to store in my top-level .well-known that needs to have some values changed within it based on environment variables. I tried using API routes to serve this file, but I can not have it prefixed by /api for this to work. Is there a way to add on a Nitro handler for this behavior? I have been looking through questions, closest thing I have seen is for dynamic values for a Content Security Policy but nothing on explicitly serving a JSON file that has dynamically changing keys....
stormy-gold
stormy-gold6/2/2025

APIRoute update function is undefined causing vite SSR to throw exception on first dev server load

I'm facing a bug I'm not sure why it's caused. I have an APIRoute to interface with Stripe. When first running bun run dev and navigating to the app's URI, this error occurs (APIRoutes update func is undefined): ``` 1:09:43 PM [vite] (ssr) Error when evaluating SSR module $vinxi/handler/ssr: Cannot read properties of undefined (reading 'update') at eval (/home/user/project/src/routeTree.gen.ts:134:66)...
No description
deep-jade
deep-jade6/2/2025

Is it possible to access headers and the request context from the loader?

I want to access the value of some request headers so I can use them in the loader. What is the best way to do so? (the equivalent in Next.js is this: https://nextjs.org/docs/app/api-reference/functions/headers)...