#"No QueryClient set" error with app dir
1 messages · Page 1 of 1 (latest)
Is the BlitzProvider placed in the rootlayout?
Yes
Any suggestions on how to proceed?
Hey sorry I missed replying. I am not sure about the way you setup your project. I could recommend to see my work in the pr https://github.com/blitz-js/blitz/pull/4146 mainly in the apps/next13 to have an idea how to set it up correctly.
I will complete the PR and add docs soon when I am able to spare some time.
@steady blade ^
Thanks! Ill take a look at it again. That is actually what I used to get it up and running but ill have another look see if I missed anything
Alright, so oddly it seems only certain queries have issues with it. Others work fine, investigating.
I think it's because we are still using pages dir as well. Queries inside pages dir are breaking.
Hi @fringe anvil , I just tested it and can confirm that is it due to using pages & app dir at the same time.
Wondering if you think this can be fixed? If not, we will just have to make the effort to transfer everything to app at once...
Ah wow, I thinks that's why I never faced this till now.
I am trying to see of there are any docs on react query that relates to this.
I tried to find something as well, but no luck yet
Yeah, spent some time looking nothing yet.
I am not able to still find an example usage of plain react query on both app and pages simultaneously.
Yup, I put out a question in the tanstack Discord with this repro: https://codesandbox.io/p/sandbox/zen-cherry-4mknmy?file=%2Fpages%2Fpages.tsx%3A4%2C1
Thats great ping me if there is some fruitful solution we could implement that by default in blitz
Hi, so apparently you need to have the provider both in _app.tsx and the root layout to make it work.
Wasn't really able to figure out / understand why that is the case for the QueryClientProvider, because that does not seem to be an issue with any other context I have come across
Thanks for the update! Do you have any issue doing this with the current providers or is some change required from our side?
I will try to spend some time this week checking this, if not, next week. Then ill let you know