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

stormy-gold
stormy-gold7/10/2025

Query parameter doesn't appear on query

Hello, I have a query parameter called dateFrom as you can see in the code below, but i'm getting a 400 from the backend when I load the page, the request in dev tools is saying the query parameter doesn't exist, could someone be able to explain why this might be happening? ``` let getLocation = $derived( createGetLocation(...
cloudy-cyan
cloudy-cyan7/5/2025

Svelte Query Prefetching

How can I prefetch queries in svelte kit? The first issue i faced is passing the queryClient from +page.server.ts like this; ```typescript import { browser } from '$app/environment';...
optimistic-gold
optimistic-gold6/10/2025

Devtools in hosted environments

The Devtools widget works great when I do local development. However, I need the dev tools to be available in the hosted environments for debugging purposes. How would I enable the tools in those environments?...
fascinating-indigo
fascinating-indigo5/15/2025

I need some help with a code

```javascript let id = $derived(data.id); let authToken = ... let getAllBetsBySheetIdQuery = useGetAllBetsBySheetId({...
rare-sapphire
rare-sapphire5/6/2025

Question for Help with SvelteKit and TanStack Query Integration

I'm new to both SvelteKit and TanStack Query, and I'm facing a 500 Internal Server Error when trying to access my dashboard page at /app/dashboard. I'm trying to implement a simple check to see if a user has at least one workspace using PocketBase as my backend and TanStack Query for data fetching. The error I'm seeing in the browser console is:...
No description
fascinating-indigo
fascinating-indigo4/20/2025

Destructuring `createQuery` attributes causes my code to stop working

I am wondering if an issue I am dealing with is a problem with my code or the package: Let's say I have the following code in the script tag of my component: ```javascript...
old-apricot
old-apricot3/28/2025

Svelte 5

Hello, is tanstack query released/compatible with Sevelte 5?
correct-apricot
correct-apricot2/27/2025

Devtools are not appearing

Hey there, I'm using ``` "@tanstack/svelte-query": "^5.66.9",...
future-harlequin
future-harlequin12/23/2024

Cache Invalidation Issue with Prefetching

With the latest current release of Svelte query and Svelte 5, I'm having an issue with invalidating queries upon a mutation. Take a simple prefetch for example in a +page.ts file, ```ts export const load = async ({ parent, fetch }) => {...
fascinating-indigo
fascinating-indigo10/26/2024

Issues with Caching and Error Handling in TanStack Svelte Query

Hi, I've recently discovered this library and have spent a few hours trying to implement it, but I'm running into some issues regarding caching and error handling. My Implementation...
foreign-sapphire
foreign-sapphire8/7/2024

How to do dependent queries in svelte?

I can figure it out for the life of me 😦 best solution I have found is something like this: ...
eastern-cyan
eastern-cyan6/8/2024

createQuery is not typed

createQuery is not typed on my application
No description
fair-rose
fair-rose3/12/2024

Bug: Making a query returns `process not defined` on CSR application

Problem: I'm trying to implement SvelteQuery into our Svelte application which is using Routify for routing. We have only client side rendering and I am wrapping the app with QueryClientProvider and trying to make a request with createQuery. When I do that I get the error ReferenceError: process is not defined. This seems like a Node error, and we don't do any server side rendering for now. I tried changing imports from @tanstack/svelte-query to @sveltestack/svelte-query so that I use sveltestack's library and when I use that one it works, so I don't see anything specific from our app being a problem. ...
other-emerald
other-emerald2/6/2024

Bug: SvelteKit - page store params becomes undefined during navigation

The problem When using params from SvelteKit $page store, they suddenly become undefined during navigation. (navigating out of page, where they're used along with createQuery). Error ```...
optimistic-gold
optimistic-gold1/22/2024

Fetch query after another query has already been fetched

I basically first need to query data to get a specific id. Based on the freshly fetched query I want to fetch another one. This might be an easy problem to solve. I tried many variations of getting it to work, but I can not get it to work reliable. Here is a snippet of the code:...
sensitive-blue
sensitive-blue10/23/2023

Query not fired with changing queryKey

I have the following +page.svelte but the query is not fired when page changes. ``` <script lang="ts"> import {...
xenial-black
xenial-black10/18/2023

Is it possible to create queries outside of context?

I have a load function in a +layout.ts I'm running a adapter-static, so all this is purely on the browser. ```ts...
xenial-black
xenial-black10/13/2023

How can I create a component for wrapping the loading states?

* A "typed" component that is 🙂 I'm using @tanstack/svelte-query@5.0.0-rc12 I have a bunch of admin panels, that are each backed by individual queries. Ideally I want to have the loading/failure states all have the same code - without boilerplate....
equal-aqua
equal-aqua8/8/2023

reactive setDefaultsOption not working

This is code I have in main +layout.svelte. I expect refetchInverval to be updated every time my store value changes, but its not
No description
Next