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

harsh-harlequin
harsh-harlequin10/9/2025

Svelte Query SSR doesn't work with ORPC

I try tanstack query svelte with ORPC. The SSR Example in the repo works but the SSR does not work when I use with ORPC. When I console log the query.isLoading, it log true on the server but it render the UI without waiting the prefetch query, I guess. I also await the prefetch query and also use the fetch from svelte as well. Did anyone got that issue? ```ts export const load: PageLoad = async ({ fetch, parent }) => { const orpc = getApiClient(fetch); const { queryClient } = await parent();...
sensitive-blue
sensitive-blue10/2/2025

Caching response in layout files

Hey! I’ve set up a main +layout.svelte file where I fetch my data. The problem is that every time I navigate to another subpage that uses this layout, the data gets fetched again. Is there a way to configure Svelte Query so that it caches the data in the layout instead of refetching it on each navigation?
exotic-emerald
exotic-emerald7/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(...
environmental-rose
environmental-rose7/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';...
sensitive-blue
sensitive-blue6/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?...
correct-apricot
correct-apricot5/15/2025

I need some help with a code

```javascript let id = $derived(data.id); let authToken = ... let getAllBetsBySheetIdQuery = useGetAllBetsBySheetId({...
adverse-sapphire
adverse-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
correct-apricot
correct-apricot4/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...
rare-sapphire
rare-sapphire3/28/2025

Svelte 5

Hello, is tanstack query released/compatible with Sevelte 5?
genetic-orange
genetic-orange2/27/2025

Devtools are not appearing

Hey there, I'm using ``` "@tanstack/svelte-query": "^5.66.9",...
apparent-cyan
apparent-cyan12/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 }) => {...
genetic-orange
genetic-orange10/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...
flat-fuchsia
flat-fuchsia8/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: ...
jolly-crimson
jolly-crimson6/8/2024

createQuery is not typed

createQuery is not typed on my application
No description
wee-brown
wee-brown3/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. ...
diverse-rose
diverse-rose2/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 ```...
stormy-gold
stormy-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:...
foreign-sapphire
foreign-sapphire10/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 {...
extended-yellow
extended-yellow10/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...
Next