Closed javier-sauma-rocketlab closed 11 months ago
I got the same issue
Open your package.json file, locate the line with @tanstack/react-query, and change the version number to ^4.35.3:
"@tanstack/react-query": "^4.35.3",
Then run: pnpm install
already did downgrade, thanks. Is more for report the issue
I forgot to list this change in the migration guide, sorry for that. hashQueryKey
was merely renamed to hashKey
because it also hashes mutation keys.
docs are updated already: https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5#hashquerykey-has-been-renamed-to-hashkey
but note that you cannot use trpc v10 with react-query v5, they are structurally incompatible. the trpc team is working on v11, which will be RQ v5 compatible. You can already try it out with the @trpc/react-query@next
tag.
I forgot to list this change in the migration guide, sorry for that.
hashQueryKey
was merely renamed tohashKey
because it also hashes mutation keys.docs are updated already: https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5#hashquerykey-has-been-renamed-to-hashkey
but note that you cannot use trpc v10 with react-query v5, they are structurally incompatible. the trpc team is working on v11, which will be RQ v5 compatible. You can already try it out with the
@trpc/react-query@next
tag.
After this, I got the SyntaxError: The requested module '@tanstack/react-query' does not provide an export named 'Hydrate'
@jakhongir-abdukhamidov are you going to make me copy every piece of the migration guide here? please read it:
https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5#hydration-api-changes
@jakhongir-abdukhamidov are you going to make me copy every piece of the migration guide here? please read it:
https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5#hydration-api-changes
Thanks for your response but downgrading to ^4.35.3 working for now.
@javier-sauma-rocketlab is it working for you now ? Because I've got same issues and after following the possible solutions here it is still not working.. still same issues
@Jeff-Ad what "same issue"? Are you using trpc like in the OP? If so, it can't work with v5 unless you upgrade to trpc@next
. Everything else should be solved. If not, please show a reproduction
@TkDodo yes I read through the solution given so after doing a downgrade the result below is what I get
my package.json file
Before the downgrade this is what I get ./nodemodules/.pnpm/@trpc+react-query@10.40.0@tanstack+react-query@5.0.0@trpc+client@10.40.0@trpc+server@10.40_j5b6dh2qmadaikfcthvzn2bani/node_modules/@trpc/react-query/dist/createHooksInternal-f1d4019d.mjs Attempted import error: 'hashQueryKey' is not exported from '@tanstack/react-query' (imported as 'hashQueryKey').
Import trace for requested module: ./nodemodules/.pnpm/@trpc+react-query@10.40.0@tanstack+react-query@5.0.0@trpc+client@10.40.0@trpc+server@10.40_j5b6dh2qmadaikfcthvzn2bani/node_modules/@trpc/react-query/dist/createHooksInternal-f1d4019d.mjs ./nodemodules/.pnpm/@trpc+react-query@10.40.0@tanstack+react-query@5.0.0@trpc+client@10.40.0@trpc+server@10.40_j5b6dh2qmadaikfcthvzn2bani/node_modules/@trpc/react-query/dist/index.mjs ./src/app/_trpc/client.ts ./src/app/_trpc/Provider.tsx
why do you think that v5 devtools would work with v4 of query ?
@TkDodo Thank you so much ...my bad ... I was thinking since its just the dev tool it should work...
Open your package.json file, locate the line with @tanstack/react-query, and change the version number to ^4.35.3:
"@tanstack/react-query": "^4.35.3",
Then run: pnpm install
THIS ONE SAVE ME!! Thank you!
Any update on when we can upgrade react-query
?
I got the same issue
Describe the bug
I was following a video to use nextj.js 13 app router, trcp, react-query and all was good until i try to call my query from the client and sudenly all crash. I try to find a solution on google but isn't reported yet. Then I check and find that react-query have released just days before this post to 5.0.0. I did a downgrade to 4.36.1 and now all work properly.
PD: I will add more info later
Ref to video follow all steps until min 7:30
trace of the error
package.json
Your minimal, reproducible example
check the code here https://github.com/jsaumap/next-trpc-start/tree/bug-react-query
Steps to reproduce
-
Expected behavior
-
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
-
Tanstack Query adapter
react-query
TanStack Query version
v5.0.0
TypeScript version
No response
Additional context
No response