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

frail-apricot
frail-apricot5/27/2025

Client context in middleware type is `undefined`

I want to send part of the client context to the server as part of a middleware I'm making. How do I change the type of the context that is passed to the client() function? Typescript is complaining it is undefined: Example from the docs: ``` const requestLogger = createMiddleware()...
robust-apricot
robust-apricot5/27/2025

Why is the current loader invoked when hovering over a child link?

Not sure how active the Github Discussions actually are, so posting here as well. I've noticed a behavior in the basic example that I cannot explain. Link to relevant route in the basic example: https://tanstack.com/start/latest/docs/framework/react/examples/start-basic?path=examples%2Freact%2Fstart-basic%2Fsrc%2Froutes%2Fposts.route.tsx ...
like-gold
like-gold5/27/2025

Failed to import custom import (TS alias)

This is a complex one. I'm running start as part of a monorepo. Start is able to directly import packages from the monorepo, but fails when a package is importing from another package.
10:50:54 AM [vite] (client) Pre-transform error: Failed to resolve import "@cf/ui/icons" from "libs/ui/react/src/components/layout-public.tsx". Does the file exist?
10:50:54 AM [vite] (client) Pre-transform error: Failed to resolve import "@cf/ui/icons" from "libs/ui/react/src/components/layout-public.tsx". Does the file exist?
...
absent-sapphire
absent-sapphire5/26/2025

Error - Cannot find module '@/styles/app.css?url'

Hi, I have a question. This file exists at this path: ```tsx import appCss from "@/styles/app.css?url"...
optimistic-gold
optimistic-gold5/26/2025

material-ui tailwindcss4

How to use start+mui+tailwindcss4? https://mui.com/material-ui/integrations/tailwindcss/tailwindcss-v4/ Their official example uses StyledEngineProvider, but it causes a flash screen....
equal-aqua
equal-aqua5/25/2025

Fetching Data In ISR & Universal rendering

How is it possible to handle data fetching in ISR and universal (isomorphic) rendering when data might be fetched both on the server and the client side? data can be loaded: On the server side during the initial page rendering On the client side during client-side navigation or revalidation...
ugly-tan
ugly-tan5/25/2025

Why createServerFn only accepts HTTP GET and POST?

Pretty simple yet unanswered question, why createServerFn only accepts HTTP methods GET and POST?
stormy-gold
stormy-gold5/25/2025

Cloudflare Workers Hosting - Docs

Hello, I noticed the docs today only mention hosting via Cloudflare Pages. It would be great to have 1-st class docs for Cloudflare Worker deployments too ---...
other-emerald
other-emerald5/25/2025

Build fails when I use a server function middleware with a server function

The middleware reads the user's data from a session cookie. From what I understand, the error is about me trying to run server-only code on the client side (like reading the encrypted session data), but I created my middleware using the server() method, so I'm confused. Reproduction...
adverse-sapphire
adverse-sapphire5/25/2025

Static Server Functions SEO friendly?

I am just wondering this since I haven't tried it, if a page with data coming from createServerFn({ type: 'static' }) is crawlable by search engine spiders
stormy-gold
stormy-gold5/25/2025

Vercel Hosting - Function Names

Hi, is it expected all my API endpoints are collapsed into a single “nitro” function? Is there any way to make the descriptions more detailed?...
No description
extended-salmon
extended-salmon5/23/2025

Nitro plugin support

Does Tanstack start support nitro plugins? I asked gemini to help me enable socket.io on my app. And it insist it's possible to use nitro plugins with tanstack start, but I'm unable to get it to work
metropolitan-bronze
metropolitan-bronze5/23/2025

i18n urls and locales

Hi everyone, I'm using TanStack Router for my application, and I'm trying to implement localization for both the app content and the URLs. For example:...
national-gold
national-gold5/22/2025

example build logs "default" is not exported by "app/client.tsx", imported by "virtual:$vinxi/handle

Hi! When run npm run build on examples such as this one below I see this warning. I'm wondering what it means because I see it in my own builds as well. Thanks! https://github.com/TanStack/router/tree/main/examples/react/start-basic...
genetic-orange
genetic-orange5/22/2025

Can't access cookie after a location.replace()

An external website makes a redirection to my website. In my loader, I call a serverFn that do a getCookie. The problem is that the external websites seems to execute a location.replace(THE_URL_TO_MY_WEBSITE) and the loader is correctly executed but can't access my website cookie (it returns null). But if I reload my page the loader access correctly the cookie. Any idea?
flat-fuchsia
flat-fuchsia5/22/2025

How to use updated client env variable value in production app?

I'm using t3 env + trpc for current tanstack app. After build the image for the bun preset. when i run the app in production i'm getting env variable error as shown in images. I'm running app using bun run .output/server/index.mjs in production. How can i pass env variable when i run the bun run .output/server/index.mjs command and how to actually parse it in trpc routes. Since it server using import.meta.env.VITE_API_URL it not a best option right!!!...
No description
extended-salmon
extended-salmon5/22/2025

Are server function URLs exposed publically?

I conduct auth checks in my beforeLoad route function and I have a serverFn named getData that I only ever call in the loader function. Do I need to check user auth in the getData function as well? I.e. is it possible for an attacker to find and use the server function endpoint without the route context?...
fair-rose
fair-rose5/21/2025

Root route loader being called multiple times

I am trying to call a function once on route load but it is being called multiple times. I tried both beforeLoad and loader but both have the same results. I do have two pathless layouts under the root route, which is why I think the loader is being called three times, but I am not sure. Any help would be appreciated.
flat-fuchsia
flat-fuchsia5/21/2025

How to add reverse proxy for production?

I'm currently using Tanstack start with tanstack query to fetch data from external api using axios.get("/api/images") which is running on localhost:9999. Now in app.config.ts there is only option for devProxy /api -> localhost:9999 which is working fine in devlopment. When i switch production build and run that the proxy doen't seems to be working even if i set the reverse proxy in caddy.
Throw an error: ERR_INVALID_URL ...
fair-rose
fair-rose5/20/2025

Adding request headers when calling useServerFn for CSRF implementation

I am trying to implement CSRF wherein i need to pass request header which will be my csrf token received during login request, can someone direct on how to achieve this functionality. I am using useServerFn to make requests wherein this would be implemented