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

protestant-coral
protestant-coral7/27/2025

Reading file in server function

The following code works in development but when I build the application the file being read is not found. The contents of the src/data directory are not copied into the build. What's the correct way to read a file with a server function? And where should the file be placed? ``` import { createServerFn } from '@tanstack/react-start'; import { readFile } from 'node:fs/promises';...
plain-purple
plain-purple7/27/2025

start for native apps?

Hello, is it possible to use start with Lynx or Tauri?...
fair-rose
fair-rose7/27/2025

Differentiate between server and client on function level.

Using docker & developing outside docker. Use-case: - Imagine you are working with tanstack start and using dynamic server function in loader prop. And inside your server function, you want to fetch some data from the server running on docker. ...
ratty-blush
ratty-blush7/27/2025

Can I create a form using loop from zod schemas automatically in Tanstack form?

Hi, I'm start learning about Tanstack form today, I want to create a form that have different fields generated from already zod schemas. Is it possible and easy using Tanstack form?
dependent-tan
dependent-tan7/26/2025

Best Practices: tRPC vs. Server Actions/Loaders with TanStack Start, Drizzle, Neon, and Better Auth

I'm migrating a mock API to TanStack Start, Drizzle ORM (Neon DB), and Better Auth. I've also started integrating tRPC for my API (/api/trpc), with routers for listings, reviews, and auth. I'm aware of the shift towards Server Actions (and React Server Components/use hook) in frameworks like Next.js, favoring server-centric data fetching/mutations over client-side libraries....
probable-pink
probable-pink7/26/2025

Failed to resolve dependency: @tanstack/react-store

I've just tried to update to the latest version of TSS following this guide: https://github.com/TanStack/router/discussions/2863 When I start the vite dev server I get: ``` web dev$ vite dev --port 3000...
fascinating-indigo
fascinating-indigo7/26/2025

API routes not working when deployed to netlify

context trying to implment social login with better auth https://www.better-auth.com/docs/integrations/tanstack the api route works fine in dev, when i deploy to netlify the api route returns a 404...
No description
conscious-sapphire
conscious-sapphire7/25/2025

throwing an error with pendingComponent set?

Is it possible to throw an error in a file route component using pendingComponent and catch it in an error boundary without pendingComponent intercepting it?
absent-sapphire
absent-sapphire7/25/2025

Rerun root route's beforeLoad when calling router.invalidate()?

I have an app where you may log in. When I log in, I'd like to rerun beforeLoad so that context.user is no longer null. As for React Start, it looks like beforeLoad is exclusively ran on the server, even with ssr: "data-only". This means once the page is loaded, all context from the root route is "stuck" until the page is hard refreshed, not even router.invalidate() can make beforeLoad run.
stormy-gold
stormy-gold7/25/2025

How can I set HTTP response code during SSR?

When I throw errors in root loader, it still returns 200, though it shows my error component properly. "setResponseCode" seems to not change anything. Throwing "notFound()" and "redirect()" seems to work for their respective purposes, but I want a 500 error page (or any arbitrary status code page).
plain-purple
plain-purple7/25/2025

When building app i get "... set "customViteReactPlugin: true" - where do i do this?

please add the vite-react plugin to your Vite config and set 'customViteReactPlugin: true' TanStack Start will not configure the vite-react plugin in future anymore. This is my vite.config.ts export default defineConfig({...
sunny-green
sunny-green7/25/2025

Server function and "internal" functions.

Is there such a thing as internal functions? Something that can only be called from Tanstack start functions. I've just created a system for sending notifications, which will only ever be consumed in server funcitons, so I'm wondering if there's a solution to ensure that sending notifications can only happen from server functions....
wise-white
wise-white7/24/2025

netlify deploy error

When deploying to Netlify, It fails building the app, with the message that env vars shouldn't be used in client code. How can I solve this?? Netlify logs: 11:45:38 PM: Secret env var "VITE_CONVEX_URL"'s value detected:...
conscious-sapphire
conscious-sapphire7/24/2025

How to prerender enabled but didn't get stuck?

i always get stuck in here, it doesn't want to exit/gracefully shutdown, it keeps waiting for nothing. ```log Σ Total size: 20.9 MB (4.91 MB gzip) [nitro 6:02:22 PM] ✔ You can preview this build using node .output/server/index.mjs [nitro 6:02:22 PM] ✔ Client and Server bundles for TanStack Start have been successfully built....
correct-apricot
correct-apricot7/23/2025

I have problem running my start in a new computer

I need help if anyone gets this issue before. Im still learning.
No description
fascinating-indigo
fascinating-indigo7/23/2025

Environment Variables Issue with TanStack Start v1.129.7

Hi! I deployed a new TanStack Start app (v1.129.7) and noticed it no longer uses Vinxi. I'm having problems accessing environment variables in server-side code during pnpm run dev. Can anyone point me to resources for solving or diagnosing this issue? I've already checked the Vite env guide, but nothing seems amiss....
sensitive-blue
sensitive-blue7/23/2025

Server functions or which feature??

Hi all, I'm looking for some advice about which feature from tanstack start do I need for this use case. 1) I have a 1 page app. The main file I have is $.tsx this file catches everything and fetch the content from our headless CMS, for example: /about-us in the browser will trigger an API call for the slug about-us. 2) The cms API response is basically an array of objects where each object has a type key to know which ReactJS component render, for example columns, text, banner, and so on. 3) One of these "cms components" is a FAQs section, around 80% of my pages have this component and I need to run some custom logic to enable/disable this query that's why my reactjs component uses useQuery instead of useSuspenseQuery, because not all pages need this component and even if they have it, not all of them will run the query.  ...
No description
correct-apricot
correct-apricot7/23/2025

useServerFn

Hi, is useServerFn a hard requirement when using server function in react-query? docs put it like this: ``` const getTime = useServerFn(getServerTime)...
foreign-sapphire
foreign-sapphire7/22/2025

No TS checks on the Link component

I created a new Tanstack Start project use the create-tsrouter-app and the links in the header component don't give me the red squiggly line when i delete the associated file route.
No description
protestant-coral
protestant-coral7/22/2025

ReferenceError: module is not defined

in my server function file called blog-server-actions.server.ts this works: import {readFile} from 'node:fs/promises'; but this does not:...