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-indigo11/22/2024

createServerFn method type

Is it by design or I'm not getting the type suggestion for POST method ?
No description
like-gold
like-gold11/21/2024

Returning response object no longer works.

I upgraded to 1.82.1 and i have a serverFn that looks like this with the new syntax: ```export const fetchPdf = createServerFn({ method: 'GET' }) .validator((data: { url: string }) => data) .handler(async ({ data: { url } }) => {...
deep-jade
deep-jade11/21/2024

Warning: A notFoundError was encountered on the route with ID "__root__"

I have an extremely simple Start application. My /app/routes/__root.tsx looks like this: ```tsx import { Outlet, ScrollRestoration,...
equal-aqua
equal-aqua11/19/2024

is there an equivalent to next/head?

which is the tanstack start way of changing the html document title using <head>?
afraid-scarlet
afraid-scarlet11/19/2024

Error with search param and router not matching

```tsx const overviewSearchParam = z.object({ startDate: fallback( z.coerce.date(), new Date(Date.now() - 30 * 24 * 60 * 60 * 1000),...
No description
correct-apricot
correct-apricot11/18/2024

Electron app integration

I got Router working with Electron and now I'm trying to do the same with Start. The entry point with Electron is index.html
<script type="module" src="/src/main.tsx"></script>...
absent-sapphire
absent-sapphire11/16/2024

MUI & Tanstack Start

I've been looking at moving one of my projects to tanstack start but the project is based on MUI which isn't ESM compatible and it also uses CSS-in-JS (emotion) for it's styling. Are there any examples of SSR using MUI?...
deep-jade
deep-jade11/15/2024

Get navigation transition state

What is the equivalent for the Next.js code below in Tanstack Start for finding whether you're in he process of navigating ```ts let [isPending, startTransition] = useTransition() ...
correct-apricot
correct-apricot11/14/2024

[vite] Error when evaluating SSR module /app/routes/__root.tsx: failed to import...

I'm still having some issues trying to get Start running. With my own UI lib and css-in-js lib. The problem seems to be vinxi: ```...
genetic-orange
genetic-orange11/14/2024

This Suspense boundary received an update before it finished hydrating.

Probably a more general SSR question. I see a race (I call it that because if I throttle my network it goes away) that causes
Uncaught Error: This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition.
Uncaught Error: This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition.
...
No description
genetic-orange
genetic-orange11/13/2024

What causes a page to load in two parts instead of one?

When I add the lines
const { data } = useSuspenseQuery(postsQueryOptions());
console.log(data);
const { data } = useSuspenseQuery(postsQueryOptions());
console.log(data);
...
xenial-black
xenial-black11/13/2024

streaming

Hey @everyone! can anyone help me with writing a mutation using Axios for streaming responses?
plain-purple
plain-purple11/12/2024

Stylesheet app.css?url import

While it works, I'm getting a Typescript error importing a stylesheet. Is this to be expected, or do I need to do it differently?...
No description
fascinating-indigo
fascinating-indigo11/12/2024

Discussion about the right approach to handle authentication with an external API

I am loving TanStart so far, it’s simplicity when implementing features is top notch. I’ve had history with TanStack since 2020 and it never fails to disappoint. One of reasons I moved from NextJs is because of TanStack’s approach to CSR being the main focus. ...
conscious-sapphire
conscious-sapphire11/12/2024

setCookie in api routes

setCookie works fine in a server function but when proxing requests through an api route, setCookie does not work. Is there a context or something additional needed to set secure http cookies? ```ts import { SplatParams } from "@tanstack/react-router"; import { createAPIFileRoute } from "@tanstack/start/api";...
fascinating-indigo
fascinating-indigo11/11/2024

Accessing env variables in server Fn

Is there a correct way to access env variables without adding VITE prefix ? Currently I can't see them inside server functions....
fascinating-indigo
fascinating-indigo11/11/2024

Using macros with Tanstack/start

I am migrating from a custom SSR setup using @tanstack/router to @tanstack/start. I managed to get everything working except for macros. Macros are used for translations with Lingui. I first tried this config:
export default defineConfig({ vite: {...
rare-sapphire
rare-sapphire11/10/2024

Invalidating router+query auth for logout

Hi, I'm trying to implement logout and I'm noticing some odd behaviour when invalidating the router. The beforeLoad handler for the root seems to have updated while beforeLoad for /dashboard has not browser console logs after logout ``` __root beforeLoad userId: null...
correct-apricot
correct-apricot11/8/2024

Variable undefined via vite plugin

My app.config.ts ```js // app.config.ts import { defineConfig } from "@tanstack/start/config";...
correct-apricot
correct-apricot11/8/2024

Feeling a lag on routing

I have pages with data loading using react query. The inbuilt loader is not used. Ideal scenario: when I click the link, that page with loading should appear. But instead I'm seeing a small lag then page with loading appears. I'm running on a Macbook Pro and I tried out in dev as well as prod there is a small lag between route changes. Is there any fix or reason behind it....