TanStackT
TanStack9mo ago
1 reply
dramatic-maroon

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.
code2.png
code1.png
code.png
Was this page helpful?