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

fascinating-indigo
fascinating-indigo3/25/2025

api routes GET returning 404

so im creating new project using Basic + Clerk Auth from docs, after that im tryin to add api /api/getAllCCTV this is the code ``` import { PrismaClient } from "@prisma/client";...
other-emerald
other-emerald3/24/2025

Tailwind v4 + pnpm + turbo

I have a monorepo using tailwind v4, pnpm and turbo repo. Currently I have split my webprojects into a folder called domains and all my shared elements inside packages. Since v4 uses a css file, I have a package called styling that exports a app.css file with all my themeing and vars which I can then consume in all of my start domains by using the following piece of code....
foreign-sapphire
foreign-sapphire3/24/2025

Testing Server Functions with Playwright

Is anyone aware of any examples of testing Server Functions with Playwright? If I do this: ```ts test('server function', async ({ page }) => { const result = await getFavorites();...
wise-white
wise-white3/24/2025

How to access parent routes loaderData in `head: () => {}`?

I want to localize my meta titles. As of now I load all my translations like this in the /$lang/route.tsx file: ```ts loader: async ({ params }) => { return {...
mute-gold
mute-gold3/23/2025

Server and client environment variables are being loaded from different .env files.

Hello, I'm working on tanstack/start app in monorepo. I also configured /src/ directory to better organize the files. The issue is that server environment variables (from process.env) are being loaded from web/src/.env, while the client variables (from import.meta.env) are being loaded from web/.env. I found that I can set vite.envDir in app.config.ts. I can technically use this to solve my issue, but the .env file would have to live in /web/src. This is not ideal. Instead I'd like the .env file to live in /web. But I couldn't find any way to set path for server envs. Is there way to set which file the server envs are loaded from? Or possibly, is there any other solution to my issue?...
rival-black
rival-black3/23/2025

Import issue in routeTree.gen.ts when creating api routes

I have created an API route in src/routes/api/auth/$.ts : ``` import { createAPIFileRoute } from "@tanstack/react-start/api"; import { auth } from "@/lib/server/auth"; ...
rare-sapphire
rare-sapphire3/23/2025

Tanstack-Query with Tanstack-Start

Hello, I went trought the official example for wiring T-Query with T-Start and some other community template, but I cannot find a standard why of doing it. Some people uses the new package tanstack-router-with-query which it highly experimental and other inject directly the query when creating the router. When using the latest, it seems the query provider is not needed any more. The tanstack-router-with-query on the other hand wrap internally the children with the query provider. What is the recommended way to wire the T-Query in T-Start specially for mutation ? my guest is that we need to inject the query in the router so we can access it in the loaders. is that true. But how about mutation ?...
rival-black
rival-black3/23/2025

Monorepo import issues

We're currently creating a POC migrating a feature from Next.js to tanstack start. We're encountering issues with paths, e.g: Cannot resolve @repo/database. The TS compiler does not complain, since it's in package.json and installed, however, the app seems to fail. ...
stormy-gold
stormy-gold3/23/2025

Tailwind V4 not recognize in production

I'm encountering an issue with Tailwind CSS in production. Everything works perfectly in local development — my Tailwind classes are recognized and applied correctly. However, in production, the classes aren't recognized, and the app.css stylesheet can't be loaded. I've already tried adding the source function, but that didn't resolve the issue. I'm deploying the project on Netlify, and aside from this Tailwind-related problem, everything else works fine. Here's my project structure:...
fair-rose
fair-rose3/23/2025

Client side routing via react-query

It might be a controversial idea. But after initial loading I wont to run all next loader requests (that happens during soft-navigation) with react-query. Right now, I achieved that behavior with next code ``` import React from 'react'; import { createFileRoute, ErrorComponent } from '@tanstack/react-router' ...
firm-tan
firm-tan3/23/2025

Is is possible to do ssr without vinxi?

Hey team, I plan on moving this webapp: https://utc.dance to tanstack start. I initialized the project from the shadcn website which had set me up with vite instead of with vinxi. My understanding is that vinxi is used for server-side stuff but it's soon going to get replaced, so I'm okay with the choice it made for me. I also looked at the example project for ssr and see that it does not require vinxi for ssr, but requires express, node-fetch, serve-static, etc. for development. I'm not sure about jumping into it with all the setup because of this issue: https://github.com/TanStack/router/issues/3195 ...
wise-white
wise-white3/22/2025

Best way to restrict i18n route params?

Hey, I'm exploring to migrate from Next.js :⁠) How do I restrict my $lang route param to only allow valid values of the languages I support? Right now I tried something like this but I would have to maintain a list of reserved paths. Also favicon.ico etc trigger this param which makes this error prone and annoying to maintain 🤔 ...
other-emerald
other-emerald3/22/2025

When will tanstack start stable version without vinxi will be released?

When will tanstack start stable version without vinxi will be released? Or can we use it now and how many changes it will have?
other-emerald
other-emerald3/22/2025

[DISSCUSSION] Tanstack Start or just Router with Vite

If you were given to build an application where all the business logic is on an external server (jwt authentication, refresh tokens, crud endpoints...) with a non-js backend framework (e.x .NET), would you still choose start or go with pure vite & tsr ? What are your thoughts on this, if you would choose Start, would you use the BFF approach or any other solutions?...
helpful-purple
helpful-purple3/22/2025

Understanding Layouts

I'm making a page that looks like the attached image, but I'm having trouble trying to figure out the proper way to setup the code. I want the side navigation to load once when a user first navigates to the url, but afterwards I don't want it to rerender. Right now it seems like the page does a complete re-render as I navigate to other segments of my course. I have a learn/$slug/layout.tsx and layout.index.tsx but I don't think this is the proper way to achieve this.. anyone have a clue?
No description
relaxed-coral
relaxed-coral3/21/2025

JS API

Hey, I'm interested in using Tanstack Start to build a framework. I would need it to have a JS API though. Basically like Vinxi. I don't think this is possible but wanted to check. I know Vinxi is fading away as a project and soon Tanstack Start will be just over Nitro and Vite directly.
genetic-orange
genetic-orange3/21/2025

Refetch of all cache keys despite invalidateQueries([key])

Hello, I am using react-query version 5.55.0 Issue: Executing my Form and then redirecting via useNavigate from react-router-dom results in a refetch of all defined useFetch hooks in the target destination....
flat-fuchsia
flat-fuchsia3/21/2025

Tanstack Start as a PWA

Hello, Has anyone managed to create a Progressive Web App (PWA) from a TanStack Start application? I have tried using vite-plugin-pwa (https://vite-pwa-org.netlify.app/) without any success. I know this was asked in the past, but I haven't found a solution or example repository....
xenial-black
xenial-black3/21/2025

Caching on server with TTL

I can't find anything in the docs (great products by the TanStack team but the docs are pretty barebones) around caching data on the server so hoping someone here might be able to validate/reject my my idea. I've got an async data loader for my root route that makes a request (could be many in the future) to an async api (at it's just a db) . I realistically only need to make this request once per user and so would be great if I could cache the result on the server and have some way to invalidate the cache when the user takes an action that requires the data to be refetched. I saw there's a static function server cache from the docs but from what I understand:...
eastern-cyan
eastern-cyan3/21/2025

How to enable i18n and nprogress client-side ?

Hello, below is how I managed to add nprogress as well as loading the react-i18next extension. Is this the proper way? Here is my client.tsx file: ```typescript...