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-gold10/7/2025

Hosting in Docker with Nitro problems

I try to follow Hosting article. I want to host it in Docker, so i choose Nitro V3. However, in the docs there's import import { nitro } from 'nitro/vite' which should be import { nitro } from 'nitro-nightly/vite' to be aligned with suggested package. Moreover, after including nitro in vite.config.js I get error:...
like-gold
like-gold10/7/2025

Request Context's properties are null when defined in Server Entry Point

I am trying to follow Server Entry Point and i try to define request context there, as defined. However in middleware for my Route i expect to get the values of context properties that i have set, but they are all null. ``` // src/routes/server-entry-point.tsx...
optimistic-gold
optimistic-gold10/7/2025

Cannot find package 'h3-v2'

I get this error with '@tanstack/nitro-v2-vite-plugin': ^1.132.40 ``` Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'h3-v2' imported from /app/.output/server/node_modules/@tanstack/start-server-core/dist/esm/request-response.js at Object.getPackageJSONURL (node:internal/modules/package_json_reader:316:9)...
xenogeneic-maroon
xenogeneic-maroon10/7/2025

Vitest tanstackStart() plugin conflict

If I include the tanstackStart() plugin in my vitest.config.ts along with the vitejs/plugin-react plugin I get the error TypeError: Cannot read properties of null (reading 'useState'). I've gotten around this by excluding the tanstackStart plugin from my vitest.config.ts and only including it in my vite.config.ts file but is this the recommended approach or am I missing something? Attached is an example test case, my vitest.config and package.json dependencies.
harsh-harlequin
harsh-harlequin10/7/2025

request.headers.get is not a function

After updating to stable V1, got this error on my server with docker node:24-alpine: TypeError: request.headers.get is not a function at getOrigin (file:///usr/server/node_modules/@tanstack/router-core/dist/esm/ssr/ssr-server.js:109:40) ... 8 lines matching cause stack trace ......
extended-yellow
extended-yellow10/7/2025

Flash of unstyled content (FOUC) issue

I've been trying to fix this FOUC unsuccesfully. Vite config: ```typescript export default defineConfig(() => ({...
old-apricot
old-apricot10/7/2025

Vercel build 404

If I include Nitro V2 plugin → Tailwind styles jerk on page refresh If I remove Nitro → The build throws 404 Not Found when deployed Basically, can’t have both working perfectly at the same time right now. I am using tanstack for only frontend ssr...
No description
fascinating-indigo
fascinating-indigo10/6/2025

How to ignore test files in routes directory?

Tanstack Router is picking up my test files in the routes folder. I there any way to ignore them? No, I don't want to move them elsewhere.
Route file "/home/**/src/routes/index.test.tsx" does not contain any route piece. This is likely a mistake.
Route file "/home/**/src/routes/index.test.tsx" does not contain any route piece. This is likely a mistake.
...
stormy-gold
stormy-gold10/6/2025

Do you know any good practice courses to improve tanstack skills?

Or more real life examples with best practices?
metropolitan-bronze
metropolitan-bronze10/6/2025

No client assets in production

Hi all, I am new to TanStack, and I am using TanStack Start with SolidJS to build a web app. I am using TailwindCSS for styling, and in development, everything works as expected. However, the output from build does not work. I see a "server" and a "client" directory in "dist", so I run the file "dist/server/server.js" with bun. The app still works, but there is no styling. When I check the networks, all the client assets such as css files are not found. Could you show me how to run the build cor...
quickest-silver
quickest-silver10/6/2025

Unknown file extension ".css"

Hello, I'm new to TanStack Start, so far everything is good and I love it! I am doing a fun experimental project and got the following error: ```...
No description
adverse-sapphire
adverse-sapphire10/5/2025

Using zod to parse environment

In the docs there is a runtime validation example in https://tanstack.com/start/latest/docs/framework/react/environment-variables#runtime-validation ``` // src/config/env.ts import { z } from 'zod'...
like-gold
like-gold10/5/2025

Issues with server routes

In Server Routes there are two examples that aren't working: - const { _splat } = params -> _splat is undefined and i get typescript errors on that declaration. - setResponseStatus is not woring at all...
conscious-sapphire
conscious-sapphire10/5/2025

I am getting this error in my tanstack start + nitro v2 deployment on vercel

[error] [nitro] RollupError: server.js (6:18): "toResponse" is not exported by "node_modules/h3/dist/index.mjs", imported by "server.js".
deep-jade
deep-jade10/5/2025

Error reading routerStream: Invalid state: Controller is already closed error

i keep getting this error, however it does not impact my application anyhow - has anyone experienced this error yet? Where should i search? code: 'ERR_INVALID_STATE' }...
quickest-silver
quickest-silver10/5/2025

Query client in loader

The docs say that if you want more control over caching and garbage collecting, we need to use TenStack Query client in loader. But further in documentation it says that TenStack Query client is created on every page request (on the server side) so users get their own data. How can I use the shared caching/deduping between routes ?...
No description
absent-sapphire
absent-sapphire10/5/2025

How to handle client preferences?

I’m currently looking at migrating from React Router to TanStack Start and trying to identify equivalent solutions to problems I’ve run into. Is there a solution for handling client-side preferences like browser language, timezone, and theme? I have a document describing this problem in more detail here: https://github.com/wrporter/starter-monorepo/blob/main/.github/decisions/7-client-preference-cookies.md...
optimistic-gold
optimistic-gold10/4/2025

Run code before SSR and CSR in RC

I'm upgrading to RC from 1.120. Prior RC, I had i18n setup with lingui similar to https://github.com/lingui/js-lingui/tree/main/examples/tanstack-start ```ts...
like-gold
like-gold10/3/2025

No error upon defining conflicting routes

Why this does not trigger any errors: ``` export const Route = createFileRoute('/server-routes')({ server: { handlers: {...
wise-white
wise-white10/3/2025

Environment variables best practices

In one example here (https://tanstack.com/start/latest/docs/framework/react/execution-model), I noticed a code snipped saying to use createServerOnlyFn to return an environment variable so that it's not accidentally leaked to the client. However, in another section (https://tanstack.com/start/latest/docs/framework/react/environment-variables) it says that env variables aren't even accessible in client code unless the name is prefixed with VITE_. I'm struggling to understand in which circumstance each solution is supposed to be used, as from my understanding they both result in the same end functionality of the variable being withheld from the client bundle. Can anyone shed some light on this and help me understand the specific cases in which one approach should be preffered? Thanks!...