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

frozen-sapphire
frozen-sapphire12/19/2024

How are Server function URL's determined, will it break when changing name or location?

What happens if a server function is renamed, or relocated, I guess the server function url signature is changed then, hence breaking older clients still running in the browser. Couldn't this be fixed by allowing API routes to target a server function? Then we decouple the url signature from the function, giving more structure, decoupling while having less magic. Instead we could make a similar RPC solution as Hono has for the API routes, i.e. importing the type to the client and with a small wrapper allowing for type save path structuring of the api route....
like-gold
like-gold12/19/2024

Broken server function type safety?

I have a server function called: ```ts const signInWithGoogle = createServerFn({ method: "POST" }) .validator((data: unknown) =>...
like-gold
like-gold12/18/2024

Issues calling server/ts function in API route

I'm running into this issue in an API route. It seems that I cannot co-locate ts functions in a functions file alongside server functions. This doesn't appear to be an issue when calling server functions not in API routes ```bash Error importing route file: Error: Invariant failed: createServerFn must be called with a function that is marked with the 'use server' pragma. Are you using the @tanstack/start-vite-plugin ? at invariant (file:///Users/am/Coding/code/node_modules/tiny-invariant/dist/esm/tiny-invariant.js:12:11)...
extended-salmon
extended-salmon12/18/2024

Vercel deployment: routes-manifest.json couldn't be found

I can't understand what is wrong, I try to deploy my app on Vercel but I get this error at the end:
Error: The file "<MY_PROJECT_PATH>/.vercel/output/routes-manifest.json" couldn't be found. This is often caused by a misconfiguration in your project.
Error: The file "<MY_PROJECT_PATH>/.vercel/output/routes-manifest.json" couldn't be found. This is often caused by a misconfiguration in your project.
...
rising-crimson
rising-crimson12/18/2024

Migrating from Next

thinking about migrating a project from next over my new year break, got a few questions: 1. is there an equivalent for unstable_cache, "use cache" or fetch() caching? currently these use the vercel data cache, so i'd like to continue this without needing a separate redis instance. i have four usages: a) database req: not critical, revalidates every 15 minutes...
like-gold
like-gold12/18/2024

Change `<html>` `lang` attribute in subroute

Is there a way to change the <html> lang attribute in a nested route (e.g. /$lang) based on URL params? Thanks...
plain-purple
plain-purple12/18/2024

How to run code when the server starts up?

Hello I am trying to run my drizzle migrations on server startup and also create a cron to do some simple tasks, but I can't find where to put this code. I have already tried using the nitro experimental tasks feature but couldn't get that to run. I will be running this on Bun in a docker container. Any help is appreciated thanks!
stormy-gold
stormy-gold12/17/2024

File API Routes Not Working?

Followed the instructions in the docs to setup a demo project. Added files for API routes and the code autogenerated as expected! However, I keep getting Not Found when I hit the routes in the browser. Am I missing a step?
adverse-sapphire
adverse-sapphire12/17/2024

createServerFn in monorepo?

is it possible to call a function created from createServerFn in a react native app or non tanstack start app? this is one of the best usecases for trpc.
adverse-sapphire
adverse-sapphire12/17/2024

useMatches re-renders twice on server with different amount of matches

Hey folks, I'm implementing breadcrumbs and ran into hydration errors. These happen because the component renders twice on the server, with a different number of matches. Here's the log, first matches mapped to match.fullPath and then matches.length ```...
metropolitan-bronze
metropolitan-bronze12/17/2024

Do I have to use .lazy to code split in tanstack/start or does it do it automatically?

Does tanstack start automatically code split my routes or do I have to use .lazy? Even using static prerendering export?
sensitive-blue
sensitive-blue12/16/2024

CSS modules, flush of unstyled content

Hey guys, we're trying to use CSS modules or just import CSS, but it doesn't work properly, css applies on the client-side asyncronously and there's a flush of unstyled content. We created issues about it as well https://github.com/TanStack/router/issues/3023 We're really want to use Start, but we can't go without working CSS modules or at least plain CSS (placed in the same folder as component)...
fascinating-indigo
fascinating-indigo12/16/2024

Blank page after navigating

I have a piece of code here that works in TanStack Router, but not in TanStack Start. ```jsx const createContact = useServerFn(createContactFn) const handleOnSubmit = async (e: FormEvent<HTMLFormElement>) => {...
fascinating-indigo
fascinating-indigo12/15/2024

HTML didn't match the client

Hi guys. Have you experienced this error before? A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:
like-gold
like-gold12/13/2024

Cron / Background jobs / Tasks

In SolidJS which also uses Nitropack under the hood it was possible to setup cron jobs using Nitropack. See docs here: https://nitro.build/guide/tasks And specific implementation in SolidJS: https://github.com/solidjs/solid-docs/issues/964 AFAIK SolidJS did nothing to enable this and it just came out of the box by using Vinxi and Nitropack....
optimistic-gold
optimistic-gold12/13/2024

How to exclude a component/function/code from SSR?

We are using react-plotly, which throws the error "Uncaught ReferenceError: self is not defined" during SSR. Is there any way to exclude a component from SSR? I've tried an import() with Supsense, which fixes the "self is not defined" error, but create a Hydration mismatch....
optimistic-gold
optimistic-gold12/12/2024

How to ensure module is imported everywhere (server, client, server functions)

I need to ensure that importExtensions is executed in all contexts. So far I only managed to make it work by importing it in client.tsx, ssr.tsx, and router.tsx, and in router.tsx I also had to make sure to execute it via a global middleware. Is there a simpler approach? router.tsx:...
fascinating-indigo
fascinating-indigo12/12/2024

type error in the router.tsx

Hi. Anyone had experienced this and were able to fix?
No description
dependent-tan
dependent-tan12/12/2024

Run Loader on Client

Is it possible to force the loader to run on the client? I'd like to call tRPC, but our procedure return user-specific results.
If the loader is called from the server I close context about the active user....