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

like-gold
like-gold3/18/2025

Flash of incorrect route before navigation

I'm experiencing an issue where I'm seeing the wrong route before being navigated to the correct route via router.navigate(). I'm positive it's due to me not yet having a complete mental model of how Tanstack Start/Router works, so any help would be very appreciated. In my app, when users navigate to /onboarding, I want to first see if there is an eligible existing organization for them to join. If there is, they should be redirected to /onboarding/join. If there isn't, they can create a new organization at the /onboarding index route. Here's the logic in the /onboarding layout route (routes/onboarding/route.tsx):...
rival-black
rival-black3/18/2025

503 error adding API routes

I'm running latest version of all packages and when I try to add API routes per the docs the app blows up with this error: ``` TypeError: Cannot read properties of undefined (reading 'update') at eval (apps/web/src/routeTree.gen.ts:6:46)...
absent-sapphire
absent-sapphire3/18/2025

displaying loader spinner when uploading images (isLoading)

Hii folks! 👋 I'm newbie in TanStack Query and I would have a question related to displaying the loader spinner on PhotoUploader component during the process of uploading a photo that the user chooses. The thing is also that I use a hook useGetAllImages where there is an allImagesLoading state which is initially 'false' if I understood correctly. ``` import { useQuery } from '@tanstack/react-query'; import { getAllImages } from '../api/uploads'; ...
rival-black
rival-black3/18/2025

Accessing the Internal Route Matcher

bit of a weird one: i'm working on an application which uses llms + tools to hit some "endpoints" like /api/v1/posts /api/v1/posts/1234. i've put endpoints in quotes because, while they are currently implemented as endpoints, that is really just an abstraction i've found useful for language models - they are extremely reliable at generating well formed URLs. in reality, these endpoints need not be exposed to anyone other than the llm. right now the tool definition looks something like: ```ts tool({ name: "getDataFromAPI",...
generous-apricot
generous-apricot3/17/2025

Testing Server Functions?

Hi friends - I still can't find any docs or guidance on how to add tests for server functions (that also run middleware). Anyone have solutions/guidance for this?...
adverse-sapphire
adverse-sapphire3/17/2025

esbuild 0.24.2 upgrade vulnerabilities

Just installing a new version of tanstack start and I get hit with this audit: pnpm audit: screenshot I'm able to fix the warning with "pnpm audit --fix", but all this does is add this to my package.json:...
No description
adverse-sapphire
adverse-sapphire3/17/2025

ERR_UNSUPPORTED_ESM_URL_SCHEME bun and createServerFn

I try to use tanstack start and create ServerFn with bun, and when I import my server function into the index.tsx in the loader function I get this error ERR_UNSUPPORTED_ESM_URL_SCHEME:
Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'bun:'
Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'bun:'
also importing it directly into my component, I get the same error....
fascinating-indigo
fascinating-indigo3/17/2025

500 error creating API route

Trying to create my first API route. 1. I added /app/api.ts as noted here: https://tanstack.com/start/latest/docs/framework/react/api-routes#setting-up-the-entry-handler ...
fascinating-indigo
fascinating-indigo3/16/2025

css takes effect in dev, but not prod

My app's __root.tsx imports my CSS like below. Is this correct?
import "uno.css";
import "@/styles/global.css";
import "uno.css";
import "@/styles/global.css";
...
jolly-crimson
jolly-crimson3/14/2025

Dynamic pages from slugs in CMS

Hi, i have a problem that my slug isnt passed to the fetchSlugs1 server function. I am new to Tanstack and i cannot wrap my head around this problem. Thank you for any help.
No description
dependent-tan
dependent-tan3/13/2025

tRPC + default api routes

Hello, Using any of the new example repos of Start + tRPC, I cannot also use the default /api I can see this added to the app.config.js...
continuing-cyan
continuing-cyan3/12/2025

How to add response headers for cors, coop, coep, etc on all routes?

The site I'm building needs to be cross origin isolated so specifically i need to add coop and coep response headers to all the pages and unfortunately the only section that mentions this in the docs points to a broken link https://tanstack.com/start/latest/docs/framework/react/middleware#readingmodifying-the-server-response The link to server function context utilities is dead unfortunately...
eastern-cyan
eastern-cyan3/12/2025

Bug middleware tanstack-start

Hello, I'm encountering an issue with the middleware. When I use it, no fetch requests are made, and I get this error in the console. I think it might be a bug in TanStack-Start, or maybe I did something wrong? error : vite-browser-exter…:node:async_hooks:3 Uncaught Error: Module "node:async_hooks" has been externalized for browser compatibility. Cannot access "node:async_hooks.AsyncLocalStorage" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details. at Object.get (vite-browser-exter…de:async_hooks:3:11)...
No description
metropolitan-bronze
metropolitan-bronze3/11/2025

beforeLoad vs. loader: Clearing Up ensureQueryData Usage

Sorry for the cryptic title, but I'm currently wondering what might be the best location for placing the ensureQueryData function in order to pre-load my data. Is this assumption correct? When I need the returned data in my RouteComponent (via Route.useLoaderData), I would place it in the loader, otherwise in beforeLoad....
foreign-sapphire
foreign-sapphire3/10/2025

Deployment on AWS

i want to know if there is a guide on how to deploy a tanstack start application to AWS is there a way we can either use serverless or maybe lambda
correct-apricot
correct-apricot3/10/2025

Server functions: how to preventing leaking server-only code (e.g. secrets) into client javascript?

How to server functions prevent leaking server-only code (secrets) into client bundles? As I understand, to use server functions, you directly import them via the bundler. This means all the typescript/javascript needed to run the server-side RPC are, at least at bundle time, before tree-shaking, visible in a client bundle. How is this prevented currently? Is there a better approach?...
graceful-blue
graceful-blue3/9/2025

Cloudflare deployment with better auth issues

Setup with basic environment variables and bun using this template (https://github.com/dotnize/tanstarter). Deploying to cloudflare pages using the presets from Tanstack Start hosting documentation. ```
server: { preset: 'cloudflare-pages',...
foreign-sapphire
foreign-sapphire3/9/2025

Issue setting up the project

Created a tsrouter app with these add ons Netlify, Sentry, Shadcn, Start, TanStack Query Ran into this issue: TypeError: Cannot read properties of undefined (reading 'update') at eval routeTree.gen.ts:20:55...
No description
harsh-harlequin
harsh-harlequin3/9/2025

Iterating Server functions

Is there a clean way to iterate server functions during runtime or startup?
xenial-black
xenial-black3/7/2025

Why aren't API routes available as a `to` typechecked destination in `Link`?

If I have an API route declare I seem unable to be able to do <Link to="/api/something" /> in a typesafe manner. The use case is using API routes for a Google Auth redirect....