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

stormy-gold
stormy-gold2/13/2025

Apollo preload error "Expected a QueryRef object"

@Lenz Weber-Tronic I'm getting this error when using useReadQuery from a ref created by the preloadQuery function your integration gives. It does appear that the data is still presenting so I'm not exactly sure what's going on. I get the error on both Client & SSR. I know this is not a lot of info to go on. I'll keep poking around....
fascinating-indigo
fascinating-indigo2/13/2025

Run start index.mjs on subpath

I have an existing express app and i want to mount the tanstack/start index.mjs on a subroute of that app. Even when setting a basepath in the router or a baseURL in app.config.ts the nitro server also responds on http://localhost:3000. The routes are correctly only available on http://localhost:3000/hub but as long as it registeres on / i can't run my existing app next to it. How can i configure tanstack start accordingly?...
ambitious-aqua
ambitious-aqua2/13/2025

Tailwind v4 Uncaught Error: Hydration failed

I'm using tailwind v4 with the following configuration ```ts // app.config.ts import tailwindcss from "@tailwindcss/vite";...
conventional-tan
conventional-tan2/13/2025

Using global variable store in @tanstack/start dangerous? or just acceptable in @tanstack/router?

I'm looking at the tanstack/router examples for data loading, and I will see this pattern ```tsx //https://tanstack.com/router/latest/docs/framework/react/guide/external-data-loading //THIS IS A GLOBAL VARIABLE let postsCache = []...
stormy-gold
stormy-gold2/12/2025

SSR/API services

Does the API server & SSR server run in different contexts? Is there a way to share services between them? I have mock graphql server. I'd like to have a single instance that is used directly in SSR & that is referenced from client side api route. Or maybe there's a better approach I should take?...
like-gold
like-gold2/12/2025

TSS with CapacitorJs how Server Functions know the prod server ip?

Hi everyone, just getting started with TSS and getting it up and running with CapacitorJs. I love isomorphic server functions, but have a question about how they would work in production for a mobile app. I understand the SF on the client proxies the request to the server to execute the function... But how does the SF in the client knows the actual IP of the production server where the SF is going to be executed? Where is this configured? On my dev server everything works seamlessly because I'm using Capacitor's server.url pointing to my local IP, but that is only for dev not prod... I read the Nitro docs, but can't find a configuration option where I set the actual production server IP....
No description
rival-black
rival-black2/12/2025

is HMR supposed to be working?

I see this PR was merged recently https://github.com/TanStack/router/pull/2316 and a few others, but HMR definitely is not working for my app running 1.102.2
vicious-gold
vicious-gold2/11/2025

Read child loader data from layout

Is possible to read a loader data form a child from withing a layout? I need that data to populare a breadcrumb and would avoid doing a separate request if possible
foreign-sapphire
foreign-sapphire2/11/2025

Streaming SSR error

Hey, I build and start locally this example TSS app and I am getting this error, when I refresh the page on http://localhost:3000/deferred NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node. This doesn't happen when I do client navigation (meaning from /client to /deferred)...
No description
correct-apricot
correct-apricot2/10/2025

Cloudflare Pages prod env vars inconsistently retrieved

Hi folks, I've seen a number of threads related to Cloudflare env variables and a number of example GitHub repos, but I'm still seeing inconsistent behavior when deployed to Cloudflare, specifically: 1. Public env vars like import.meta.env.VITE_BETTER_AUTH_URL that appear populated in the Cloudflare console for the worker are undefined at execution time 2. getContext("cloudflare") seems to inconsistently return undefined in general which creates bugs in my application...
fascinating-indigo
fascinating-indigo2/10/2025

What is the expected behaviour of ssr:false

I asked a previous question that ssr:false breaks vinxi. I now use https://tanstack.com/router/v1/docs/framework/react/examples/basic-ssr-file-based as my starting point so i only run "node server.js". My entry-server.tsx is also identical. As soon as i set ssr:false on a route it is correctly not rendered on the server, but it is also not rendered on the client so it never appears. Do i need to declare the route differently? This does not render anything: ```...
other-emerald
other-emerald2/10/2025

Getting 'cannot read properties of null (Reading 'useContext') after building.

Hi I am building the frontend for a WordPress website using react and Tanstack. Everything runs fine in development. But after a build the app and add it to my wordpress website, I get this type error wherever I use 'getRouteApi' or 'useSuspenseQuery' But it only happens on first load. When I reload it works fine....
robust-apricot
robust-apricot2/10/2025

How to transpile packages in monorepo without dedicated build step?

In our mono repo we hava a shared components package written in typescript. in our other apps (vite and nextjs based) we can just import it - however in tanstack start as soon as I import something in the __root.tsx I get an error: ``` TypeError: (0 , vite_ssr_import_1.default) is not a function at eval (repo/packages/components/src/AppFrame.tsx:5:52) at async ESModulesEvaluator.runInlinedModule (file://repo/tanstack-app/node_modules/vite/dist/node/module-runner.js:1049:5)...
other-emerald
other-emerald2/9/2025

Strange SSR Error

Any clue what might cause this?
No description
robust-apricot
robust-apricot2/9/2025

TanStack Start or TanStack Router + Astro

Hi everyone, I'm building a project with two main parts: a public-facing section (landing page, about page, etc.) and an SPA. Since we're using an external Express backend, I'm debating whether to build the public-facing part with Astro and the SPA with TanStack Router or just use TanStack Start for everything. If I go with TanStack Start, I'd still use the external Express backend instead of the built-in API routes. Would love to hear your thoughts! Thank you...
rare-sapphire
rare-sapphire2/8/2025

Will beforeLoad prevent the OAuth authorization page from redirecting?

I have three key configurations, and when I click the login button, the page fails to redirect to the OAuth authorization page. The log shows that all paths' beforeLoad are executed again, which is described as normal in the documentation, but I don't understand why the authorization cannot redirect. // __root.tsx const getUser = createServerFn({ method: "GET" }).handler(async () => { const { headers } = getWebRequest()!; const session = await auth.api.getSession({ headers });...
No description
wee-brown
wee-brown2/8/2025

Route Context Undefined in Child Route on Reload

I have a parent route layout at /orgs/$slug that fetches the organization by slug and makes it available to the child route. In the child route /orgs/$slug/dashboard, the organization is inferred as an Organization (non-optional). However, upon reloading the page, I encounter the following error:Can't access property 'id', context.organization is undefined. This error occurs when trying to access the organization data in the child route, even though it should be available according to the TS defintion. Reproduction: https://github.com/thomasfqb12/tanstack-start-undefined-context...
wee-brown
wee-brown2/8/2025

Configuring server.allowedHosts for tunneling

I am building an API route to handle webhook events. For local development, I need to configure a tunnel solution (e.g., ngrok, tunnelmole) to receive the events. In recent versions, I encounter this error: ``` Blocked request. This host ("[subdomain].tunnelmole.net") is not allowed. ...
complex-teal
complex-teal2/8/2025

How to configure tanstack start to completely opt out of SSR while keeping server functions?

I built my project from scratch using the docs https://tanstack.com/start/latest/docs/framework/react/build-from-scratch. What adjustments should i make to achieve desired behaviour?...
sensitive-blue
sensitive-blue2/8/2025

Anyone get tanstack start working with deno

would be interested in seeing a starter repo