T
TanStack4mo ago
evident-indigo

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: GET http://localhost:5173/app/dashboard 500 (Internal Server Error) I've set up PocketBase in my app and I'm trying to use TanStack Query to fetch workspace data, but something is going wrong with either my load functions or how I'm integrating these technologies. Could someone explain the proper way to set up a SvelteKit project with PocketBase and TanStack Query, and how to correctly handle data fetching in load functions? I'm particularly confused about how to structure my code to avoid these server-side errors.
No description
No description
No description
1 Reply
literary-plum
literary-plum4mo ago
Hi @Defree_harold , the first bug I can see is that you're using useQuery instead of createQuery. Not sure if you're interested in having type checking, but that would catch that problem. Also, are you using the current v5 release, or the experimental runes version?

Did you find this page helpful?