T3Stack 'react-query' not found
Hey, I'm trying to migrate to t3 stack, but I've been using react-query, but I am getting this error:
30 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
what trpc version are you on
v10 needs @tanstack/react-query
v9 needs react-query
should be the latest one
"@tanstack/react-query": "^4.3.9",
trpc v9 isnt compatible with tanstack query v4
it needs react-query v3
Owh
or you can upgrade your trpc stuff to v10 beta
Okay, Imma go with beta, thanks
Should I take a look at
npx create-t3-app@beta
or is it fine just by upgrading packages?basically all the boilerplate is different for trpc v10
id do
create-t3-app@next
beware we have a dependency issue right now, you need to downgrade next-auth to 4.10 before installing packagesSure, okay. Thanks for letting me know
Emm, I've installed
@next
one, but still getting the react-query
dependency error. So do I have to install the old react query?youre getting an error about react-query dependencies on just the default output of
npx create-t3-app@next
?correct
what line of what file?
trpc-next.cjs.dev is a file from trpc v9
reinstall your dependencies
pretty weird, cuz it is still happening
Maybe I missed something to copy from boilerplate
I've tried the same
create-t3-app@next
just by replacing react-query
with @tanstack/react-query
and then upgrading all packages, then it threw me same error. (disclaimer: I didn't use next-auth
)eplacing react-query with @tanstack/react-querywhat does this mean?
replacing, typo*
oh
just uninstalling
react-query
and installing @tanstack/react-query
there is no react-query to uninstall in a ct3a@next
there is no predefined package there?
ct3a@next comes with @tanstack/react-query
oh I see
now it's installed the correct version of @next, maybe I did something wrong in the terminal before
@cje one more question that I ran into during the migration... how's the caching handled in trpc? On normal API endpoint routes I used
res.setHeader('Cache-Control', ...)
. What I can use now?Look at what’s inside of ctx
Did I miss something to set up?
Currently it provides me only the
prisma
client.
oh my bad looks like the template currently doesn't do it for you
try this
theres also this https://trpc.io/docs/v10/caching
Response Caching | tRPC
The below examples uses Vercel's edge caching to serve data to your users as fast as possible.
probably better to do that than what i said
yep, thanks 🙂