Svelte-query - undefined queryclient
I want to integrate svelte-query in sveltekit app , as given in docs I have done all installation and setup but am getting this weird error in console
cannot read properties of undefined (QueryClient)
I have declared the variable let queryclient = new QueryClient()
, Just dont know what's wrong in here
Thanks!5 Replies
foreign-sapphire•3y ago
Hi @Devr , can you share the file this is from? It looks like you might need to import QueryClient
yelping-magentaOP•3y ago
@Raytuzio I only have this code in my +layout.svelte
foreign-sapphire•3y ago
Okay, that seems set up correctly, what are you calling and where are you getting the error?
yelping-magentaOP•3y ago
Hey @Raytuzio actually my issue is resolved, I just saw docs and there's something updated with that queries doesn't run server, So I guess that was causing the issue and now its all good , Thanks!
foreign-sapphire•3y ago
Great, I've been editing the docs as people have been reporting issues, I've now settled on what I think is the best way to use it with sveltekit so hopefully no more changes!